yusheng пре 11 месеци
родитељ
комит
587106d46b

+ 22 - 15
src/components/addDoc/api/index.js

@@ -13,9 +13,9 @@ export async function getDocTreeListAPI(data) {
 }
 
 /**
-* 查询文件数据
-* @data data
-*/
+ * 查询文件数据
+ * @data data
+ */
 export async function filePageAPI(data) {
   const res = await request.post('/fm/file/pageBusiness', data);
   if (res.data.code == 0) {
@@ -51,7 +51,7 @@ export async function fileGetByIdAPI(id) {
  * ids查询文件列表
  * @data data
  */
- export async function queryIds(data) {
+export async function queryIds(data) {
   const res = await request.post('/fm/file/queryIds', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -59,12 +59,12 @@ export async function fileGetByIdAPI(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
-
 // 获取编码树
 export async function selectTreeList(data) {
-  const res = await request.post(`/main/business_code_category/selectTreeList`, data);
+  const res = await request.post(
+    `/main/business_code_category/selectTreeList`,
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -72,7 +72,10 @@ export async function selectTreeList(data) {
 }
 // 获取右侧列表
 export async function listParentId(data) {
-  const res = await request.post(`/main/business_code_category/listPageParentId`, data);
+  const res = await request.post(
+    `/main/business_code_category/listPageParentId`,
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -87,10 +90,11 @@ export async function pageSegment(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 生成编码
 export async function getCode(id) {
-  const res = await request.get(`/main/business_code_category/applyForCode/`+id);
+  const res = await request.get(
+    `/main/business_code_category/applyForCode/` + id
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -101,7 +105,7 @@ export async function getCode(id) {
  * 上传文件
  * @param file 文件
  */
- export async function uploadFileNew (data) {
+export async function uploadFileNew(data) {
   const formData = new FormData();
   formData.append('multiPartFile', data.multiPartFile);
   formData.append('module', data.module);
@@ -112,11 +116,14 @@ export async function getCode(id) {
   return Promise.reject(new Error(res.data.message));
 }
 // 编码方案
-export async function listCode(code) {
-  const res = await request.get(`/main/business_code_category/listCode/`+code);
+export async function listCode(data = {}) {
+  const res = await request.get(
+    `/main/business_code_category/listCode/${data.id || '0'}` +
+      '?parentId=' +
+      (data.parentId || '')
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
-

+ 36 - 28
src/components/addDoc/browse.vue

@@ -5,7 +5,6 @@
     custom-class="ele-dialog-form"
     append-to-body
     :fullscreen="true"
-    :maxable="true"
   >
     <iframe
       :src="fileUrl"
@@ -19,35 +18,44 @@
 </template>
 
 <script>
+import { getFileType } from './util.js';
 
+export default {
+  data() {
+    return {
+      fileUrl: '',
+      showEditFlag: false
+    };
+  },
 
-  export default {
-    data() {
-      return {
-        fileUrl: '',
-        showEditFlag: false
-      };
+  methods: {
+    open(row){
+      this.showEditFlag=true
+      this.setFileUrl(row)
     },
-
-    methods: {
-      open(row) {
-        this.showEditFlag = true;
-        this.setFileUrl(row);
-      },
-      setFileUrl(row) {
-        console.log(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];
-        this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
-        this.visible = true;
-      }
+    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]
+      this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+      
+      // const fileExt = file.name.substr(file.name.lastIndexOf('.') + 1);
+      // this.fileType = getFileType().includes(fileExt) ? 2 : 1;
+      // if (this.fileType == 2) {
+      //   this.fileUrl =
+      //     '/fm/' +
+      //     (['dxf', 'dwg'].includes(fileExt) ? '2DViewer' : '3DViewer') +
+      //     '/view.html?url=' +
+      //     sessionStorage.filePath +
+      //     '/' +
+      //     row.outputNdsFiles;
+      // } else {
+      //   this.fileUrl = '/kkfile/onlinePreview?url=' + btoa(url);
+      //   // 'http://192.168.1.107:18082/kkfile/onlinePreview?url=' + btoa(url);
+      // }
     }
-  };
+  }
+};
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+</style>

+ 108 - 107
src/components/addDoc/doc_template.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="ele-body" style="height: 60vh; overflow: auto">
+  <div class="ele-body" style="height:60vh;overflow: auto;">
     <el-card shadow="never" v-loading="loading">
       <ele-split-layout
         width="210px"
@@ -11,7 +11,8 @@
           <ele-toolbar class="ele-toolbar-actions">
             <div style="margin: 5px 0"> </div>
           </ele-toolbar>
-          <div class="ele-border-lighter sys-organization-list">
+             
+          <div class="ele-border-lighter sys-organization-list"  style="height: 65vh">
             <el-tree
               ref="tree"
               :data="data"
@@ -23,7 +24,7 @@
               :default-expand-all="true"
               @node-click="onNodeClick"
             >
-              <span class="custom-tree-node" slot-scope="{ node }">
+              <span class="custom-tree-node" slot-scope="{ node, data }">
                 <ElementTreeLine
                   :node="node"
                   :showLabelLine="true"
@@ -52,124 +53,124 @@
 </template>
 
 <script>
-  //
-  import FileTableList from './file-table-listTemplate.vue';
-  import { getDocTreeListAPI } from './api';
-  import { mapGetters } from 'vuex';
+//
+import FileTableList from './file-table-listTemplate.vue';
+import { getDocTreeListAPI } from './api';
+import { mapGetters } from 'vuex';
 
-  import ElementTreeLine from 'element-tree-line';
-  // css
-  import 'element-tree-line/dist/style.scss';
-  export default {
-    components: { FileTableList, ElementTreeLine },
+import ElementTreeLine from 'element-tree-line';
+// css
+import 'element-tree-line/dist/style.scss';
+export default {
+  components: { FileTableList, ElementTreeLine },
 
-    data() {
-      return {
-        loading: true,
-        // 列表数据
-        data: [],
-        fileType: 0,
-        // 选中数据
-        current: {}
-      };
-    },
-    props: {
-      lcyStatus: null, //1:文档工作区 2:文档归档区 3:文档发布区 4:文档废止区
+  data() {
+    return {
+      loading: true,
+      // 列表数据
+      data: [],
+      fileType:0,
+      // 选中数据
+      current: {}
+    };
+  },
+  props: {
+    lcyStatus: '', //1:文档工作区 2:文档归档区 3:文档发布区 4:文档废止区
 
-      disabledTableList: {
-        //已选择列表
-        default: () => []
-      }
-    },
-    computed: {
-      ...mapGetters(['user'])
-    },
-    created() {
-      this.query();
-    },
+    disabledTableList: {
+      //已选择列表
+      default: () => []
+    }
+  },
+  computed: {
+    ...mapGetters(['user'])
+  },
+  created() {
+    this.query();
+  },
 
-    methods: {
-      /* 查询 */
-      async query() {
-        this.loading = true;
-        let query = {
-          type: this.fileType,
-          currentUserId: this.user.info.userId
-        };
-        this.data = await getDocTreeListAPI(query);
+  methods: {
+    /* 查询 */
+    async query() {
+      this.loading = true;
+      let query = {
+        type: this.fileType,
+        currentUserId: this.user.info.userId
+      };
+      this.data = await getDocTreeListAPI(query);
 
-        this.current = null;
-        this.$nextTick(() => {
-          this.$refs.tree.setCurrentKey(this.data[0].id);
+      this.current = null;
+      this.$nextTick(() => {
+        this.$refs.tree.setCurrentKey(this.data[0].id);
 
-          this.onNodeClick(this.data[0]);
+        this.onNodeClick(this.data[0]);
+      });
+      this.loading = false;
+    },
+    /* 选择数据 */
+    onNodeClick(row) {
+      if (row) {
+        this.current = row;
+        this.$nextTick(() => {
+          this.$refs.tableRef.reload();
         });
-        this.loading = false;
-      },
-      /* 选择数据 */
-      onNodeClick(row) {
-        if (row) {
-          this.current = row;
-          this.$nextTick(() => {
-            this.$refs.tableRef.reload();
-          });
-        } else {
-          this.current = null;
-        }
-      },
-
-      getTableList() {
-        return this.$refs.tableRef.getTableList();
+      } else {
+        this.current = null;
       }
+    },
+
+    getTableList() {
+      return this.$refs.tableRef.getTableList();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .sys-organization-list {
-    height: calc(100vh - 180px);
-    box-sizing: border-box;
-    border-width: 1px;
-    border-style: solid;
-    overflow: auto;
-  }
+.sys-organization-list {
+  height: calc(100vh - 180px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
 
-  .sys-organization-list :deep(.el-tree-node__content) {
-    height: 30px;
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 30px;
 
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
+  & > .el-tree-node__expand-icon {
+    margin-left: 10px;
   }
-  .custom-tree-node {
-    display: flex;
-    align-items: center;
-  }
-  :deep(.el-popover) {
-    min-width: 50px;
-    position: fixed;
-  }
-  :deep(.el-link--inner) {
-    padding: 3px 0;
-  }
-  // :deep(.element-tree-node-line-hor) {
-  //   border-bottom: 1px solid #dcdfe6;
-  // }
-  // :deep(.element-tree-node-line-ver) {
-  //   border-left: 1px solid #dcdfe6;
-  // }
+}
+.custom-tree-node {
+  display: flex;
+  align-items: center;
+}
+:deep(.el-popover) {
+  min-width: 50px;
+  position: fixed;
+}
+:deep(.el-link--inner) {
+  padding: 3px 0;
+}
+// :deep(.element-tree-node-line-hor) {
+//   border-bottom: 1px solid #dcdfe6;
+// }
+// :deep(.element-tree-node-line-ver) {
+//   border-left: 1px solid #dcdfe6;
+// }
 </style>
 <style lang="scss">
-  .el-tree
-    > .el-tree-node
-    > .el-tree-node__content:nth-of-type(1)
-    .element-tree-node-line-hor {
-    border: none;
-  }
-  .el-tree
-    > .el-tree-node
-    > .el-tree-node__content:nth-of-type(1)
-    .element-tree-node-line-ver {
-    border: none;
-  }
-</style>
+.el-tree
+  > .el-tree-node
+  > .el-tree-node__content:nth-of-type(1)
+  .element-tree-node-line-hor {
+  border: none;
+}
+.el-tree
+  > .el-tree-node
+  > .el-tree-node__content:nth-of-type(1)
+  .element-tree-node-line-ver {
+  border: none;
+}
+</style>

+ 19 - 12
src/components/addDoc/file-edit.vue

@@ -161,7 +161,7 @@
         showEditFlag: false,
         title: '',
         type: '新建附件',
-        nodeDataCode: ''
+        nodeData: {}
       };
     },
     computed: {
@@ -183,26 +183,32 @@
       async getTreeCode() {
         let nodeData = {};
         await this.$nextTick(() => {
-          nodeData = this.$refs.cascaderRef.getCheckedNodes();
+          // console.log(this.$refs,'this.$refs')
+          nodeData = this.$refs.cascaderRef&&this.$refs.cascaderRef.getCheckedNodes();
         });
-        this.nodeDataCode = nodeData[0]?.data?.code;
+        this.nodeData = {
+          id: nodeData[0]?.data?.id,
+          parentId:
+            nodeData[0]?.data?.parentId != 0 ? nodeData[0]?.data?.parentId : ''
+        };
       },
       async initFileCode() {
         await this.getTreeCode();
-        this.options = this.nodeDataCode
-          ? await listCode(this.nodeDataCode)
-          : [];
+        this.options = this.nodeData.id ? await listCode(this.nodeData) : [];
         if (this.options.length > 0) {
           this.form.businessCodeId = this.options[0].id;
-        }else{
-          this.form.businessCodeId=''
+          this.form.codeType = this.options[0].parentId;
+        } else {
+          this.form.businessCodeId = '';
         }
       },
       async open() {
         this.showEditFlag = true;
-        this.list = await selectTreeList();
-        await this.initFileCode();
-        this.setTree(this.list);
+        this.$nextTick(async () => {
+          this.list = await selectTreeList();
+          await this.initFileCode();
+          this.setTree(this.list);
+        });
       },
 
       setTree(data) {
@@ -220,7 +226,8 @@
           pageNum: 1,
           size: 100,
           parentId: val,
-          code: this.nodeDataCode
+          objId: this.nodeData?.id,
+          objParentId: this.nodeData?.parentId
         });
         this.options = data.list.filter((item) => item.type == 2);
         this.form.businessCodeId = '';

+ 160 - 161
src/components/addDoc/file-table-listTemplate.vue

@@ -6,7 +6,6 @@
       :columns="columns"
       :datasource="datasource"
       tool-class="ele-toolbar-form"
-      :needPage="false"
       row-key="id"
       :selection.sync="selection"
       :toolbar="false"
@@ -28,172 +27,172 @@
 </template>
 
 <script>
-  import { filePageAPI } from './api';
-  import browse from './browse.vue';
+import { filePageAPI } from './api';
+import browse from './browse.vue';
 
-  export default {
-    components: { browse },
-    props: {
-      // 上级
-      parentData: {
-        type: Object,
-        default: () => {}
-      },
-
-      disabledTableList: {
-        //已选择列表
-        default: () => []
-      }
+export default {
+  components: { browse },
+  props: {
+    // 上级
+    parentData: {
+      type: Object,
+      default: () => {}
     },
 
-    data() {
-      return {
-        selection: [],
-        columns: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            selectable: (row, index) => {
-              return !this.disabledTableList
-                .map((item) => item.id)
-                .includes(row.id);
-            }
-          },
-          {
-            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',
+    disabledTableList: {
+      //已选择列表
+      default: () => []
+    }
+  },
 
-            showOverflowTooltip: true,
-            minWidth: 200,
-            formatter: (_row, _column, cellValue) => {
-              return cellValue[0]?.name;
-            }
-          },
-          {
-            prop: 'version',
-            label: '版本',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 100
-          },
-          {
-            prop: 'checkOutUserName',
-            label: '检出人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 100
-          },
-          {
-            prop: 'checkOutStatus',
-            label: '检出状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 100,
-            formatter: (_row, _column, cellValue) => {
-              return cellValue == 1 ? '已检出' : '';
-            }
-          },
-          {
-            prop: 'checkOutTime',
-            label: '检出时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 160
-          },
-          {
-            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
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 150,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            fixed: 'right'
+  data() {
+    return {
+      selection: [],
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          selectable: (row, index) => {
+            return !this.disabledTableList
+              .map((item) => item.id)
+              .includes(row.id);
           }
-        ]
-      };
-    },
-    created() {},
+        },
+        {
+          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',
+
+          showOverflowTooltip: true,
+          minWidth: 200,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue[0]?.name;
+          }
+        },
+        {
+          prop: 'version',
+          label: '版本',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100
+        },
+        {
+          prop: 'checkOutUserName',
+          label: '检出人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100
+        },
+        {
+          prop: 'checkOutStatus',
+          label: '检出状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue == 1 ? '已检出' : '';
+          }
+        },
+        {
+          prop: 'checkOutTime',
+          label: '检出时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 160
+        },
+        {
+          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
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ]
+    };
+  },
+  created() {},
 
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return filePageAPI({
-          ...where,
-          ...order,
-          pageNum: page,
-          size: limit,
-          directoryId: this.parentData?.id
-        });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ pageNum: 1, where: where });
-      },
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      return filePageAPI({
+        ...where,
+        ...order,
+        pageNum: page,
+        size: limit,
+        directoryId: this.parentData?.id
+      });
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ pageNum: 1, where: where });
+    },
 
-      browseOpen(row) {
-        this.$refs.browseRef.open(row);
-      },
-      getTableList() {
-        return JSON.parse(JSON.stringify(this.selection));
-      }
+    browseOpen(row) {
+      this.$refs.browseRef.open(row);
+    },
+    getTableList() {
+      return JSON.parse(JSON.stringify(this.selection));
     }
-  };
+  }
+};
 </script>

+ 211 - 204
src/components/addDoc/fileUpload.vue

@@ -32,224 +32,231 @@
 </template>
 
 <script>
-  import { getFileList, getFile, removeFile } from '@/api/system/file/index.js';
-  import { uploadFileNew } from './api';
-  import { getImageUrl, getImagePath } from '@/utils/file';
-  export default {
-    props: {
-      value: {
-        type: [Array, String],
-        default: () => []
-      },
-      multiple: {
-        type: Boolean,
-        default: false
-      },
-      // 所属模块
-      module: {
-        type: String,
-        required: true
-      },
-      // 文档库
-      showLib: {
-        type: Boolean,
-        default: false
-      },
-      // 限制数量
-      limit: {
-        type: Number,
-        default: -1
-      },
-      // 限制大小 mb
-      size: {
-        type: Number,
-        default: 1000
-      },
-      disabled: {
-        default: false,
-        type: Boolean
-      }
+import {
+  getFileList,
+  getFile,
+  removeFile
+} from '@/api/system/file/index.js';
+import {
+  uploadFileNew,
+} from './api';
+import { getImageUrl, getImagePath } from '@/utils/file';
+export default {
+  props: {
+    value: {
+      type: [Array, String],
+      default: () => []
     },
-    data() {
-      return {
-        documentVisible: false,
-        selectItem: null,
-        loading: false,
-        documentForm: {
-          name: ''
-        },
-        columns: [
-          {
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '文档名称',
-            prop: 'name',
-            minWidth: '180',
-            showOverflowTooltip: true
-          },
-          {
-            label: '文档类型',
-            prop: 'type'
-          },
-          {
-            label: '系统'
-          },
-          {
-            label: '储存路径',
-            prop: 'storePath',
-            minWidth: '180',
-            showOverflowTooltip: true
-          },
-          {
-            label: '模块名',
-            prop: 'module'
-          },
-          {
-            label: '上传时间',
-            prop: 'createTime'
-          }
-        ]
-      };
+    multiple: {
+      type: Boolean,
+      default: false
     },
-    computed: {
-      fileList: {
-        set(val) {
-          // console.log(val);
-          this.$emit(
-            'input',
-            val.map((item) => ({
-              ...item,
-              url: getImagePath(item.url)
-            }))
-          );
+    // 所属模块
+    module: {
+      type: String,
+      required: true
+    },
+    // 文档库
+    showLib: {
+      type: Boolean,
+      default: false
+    },
+    // 限制数量
+    limit: {
+      type: Number,
+      default: -1
+    },
+    // 限制大小 mb
+    size: {
+      type: Number,
+      default: 1000
+    },
+    disabled: {
+      default: false,
+      type: Boolean
+    }
+  },
+  data() {
+    return {
+      documentVisible: false,
+      selectItem: null,
+      loading: false,
+      documentForm: {
+        name: ''
+      },
+      columns: [
+        {
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center'
         },
-        get() {
-          // console.log(this.value, 2);
-          if (!Array.isArray(this.value)) return [];
-          const arr =
-            (this.value &&
-              this.value.map((item) => ({
-                ...item,
-                url: getImageUrl(item.url)
-              }))) ||
-            [];
-          return arr;
+        {
+          label: '文档名称',
+          prop: 'name',
+          minWidth: '180',
+          showOverflowTooltip: true
+        },
+        {
+          label: '文档类型',
+          prop: 'type'
+        },
+        {
+          label: '系统'
+        },
+        {
+          label: '储存路径',
+          prop: 'storePath',
+          minWidth: '180',
+          showOverflowTooltip: true
+        },
+        {
+          label: '模块名',
+          prop: 'module'
+        },
+        {
+          label: '上传时间',
+          prop: 'createTime'
         }
+      ]
+    };
+  },
+  computed: {
+    fileList: {
+      set(val) {
+        // console.log(val);
+        this.$emit(
+          'input',
+          val.map((item) => ({
+            ...item,
+            url: getImagePath(item.url)
+          }))
+        );
+      },
+      get() {
+        // console.log(this.value, 2);
+        if (!Array.isArray(this.value)) return [];
+        const arr =
+          (this.value &&
+            this.value.map((item) => ({
+              ...item,
+              url: getImageUrl(item.url)
+            }))) ||
+          [];
+        return arr;
       }
-    },
+    }
+  },
 
-    methods: {
-      //点击查看图片
-      handleItem(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
-      delFileList() {
-        this.$emit('input', []);
-      },
-      handleOpenLib() {
-        this.documentVisible = true;
-        this.$nextTick(() => {
-          this.reload();
-        });
-      },
-      //图文档勾选
-      submitDocument() {
-        this.$emit('input', [
-          { url: this.selectItem.storePath, ...this.selectItem }
-        ]);
-        this.documentVisible = false;
-      },
-      datasource({ page, limit }) {
-        return getFileList({
-          ...this.documentForm,
-          pageNum: page,
-          size: limit
-        });
-      },
-      reload() {
-        this.$refs.table.reload();
-      },
-      beforeRemove(file) {
-        if (file.id) {
-          return removeFile({
-            fileId: file.id
-          }).then(() => {
-            return true;
-          });
-        } else {
+  methods: {
+    //点击查看图片
+    handleItem(file) {
+      getFile({ objectName: file.storePath }, file.name);
+    },
+    delFileList() {
+      this.$emit('input', []);
+    },
+    handleOpenLib() {
+      this.documentVisible = true;
+      this.$nextTick(() => {
+        this.reload();
+      });
+    },
+    //图文档勾选
+    submitDocument() {
+      this.$emit('input', [
+        { url: this.selectItem.storePath, ...this.selectItem }
+      ]);
+      this.documentVisible = false;
+    },
+    datasource({ page, limit }) {
+      return getFileList({
+        ...this.documentForm,
+        pageNum: page,
+        size: limit
+      });
+    },
+    reload() {
+      this.$refs.table.reload();
+    },
+    beforeRemove(file) {
+      if (file.id) {
+        return removeFile({
+          fileId: file.id
+        }).then(() => {
           return true;
-        }
-      },
-      handleRemove(file, fileList) {
-        this.fileList = fileList;
-      },
-      beforeUpload(file) {
-        // if (file.size / 1024 / 1024 > this.size) {
-        //   this.$message.error(`大小不能超过 ${this.size}MB`);
-        //   return false;
-        // }
+        });
+        return true;
+      } else {
+        return true;
+      }
+    },
+    handleRemove(file, fileList) {
+      this.fileList = fileList;
+    },
+    beforeUpload(file) {
+      // if (file.size / 1024 / 1024 > this.size) {
+      //   this.$message.error(`大小不能超过 ${this.size}MB`);
+      //   return false;
+      // }
 
-        if (this.limit > 0 && this.fileList.length === this.limit) {
-          this.$message.error(`最多上传 ${this.limit}个文件`);
-          return false;
-        }
-        this.loading = true;
-        return uploadFileNew({
-          module: this.module,
-          multiPartFile: file
-        })
-          .then((res) => {
-            if (res.data) {
-              this.$emit('input', [
-                ...(this.value || []),
-                { ...file, url: res.data.storePath, ...res.data }
-              ]);
-            }
-            this.$emit('fileChange', res.data);
-            return res.data;
-          })
-          .finally(() => {
-            this.loading = false;
-          });
-      },
-      handlRequest() {
-        return Promise.resolve();
+      if (this.limit > 0 && this.fileList.length === this.limit) {
+        this.$message.error(`最多上传 ${this.limit}个文件`);
+        return false;
       }
-      // onSuccess(response, file, fileList){
-      //   alert(1)
-      //    this.$emit('fileChange',file)
-      // },
+      this.loading = true;
+      return uploadFileNew({
+        module: this.module,
+        multiPartFile: file
+      })
+        .then((res) => {
+          if (res.data) {
+            this.$emit('input', [
+              ...(this.value || []),
+              { ...file, url: res.data.storePath, ...res.data }
+            ]);
+          }
+          this.$emit('fileChange', res.data);
+          return res.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    handlRequest() {
+      return Promise.resolve();
     }
-  };
+    // onSuccess(response, file, fileList){
+    //   alert(1)
+    //    this.$emit('fileChange',file)
+    // },
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .upload-file {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
+.upload-file {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
 
-    .lib {
-      margin-left: 12px;
-    }
+  .lib {
+    margin-left: 12px;
+  }
 
-    .imgs-box {
-      margin-left: 10px;
-      flex: 1;
-    }
-    .imgs-box .imgs-p {
-      height: 30px;
-      background: #f0f3f3;
-      line-height: 30px;
-      min-width: 480px;
-      margin-bottom: 5px;
-      padding: 0 10px;
-      display: flex;
-      justify-content: space-between;
-    }
+  .imgs-box {
+    margin-left: 10px;
+    flex: 1;
+  }
+  .imgs-box .imgs-p {
+    height: 30px;
+    background: #f0f3f3;
+    line-height: 30px;
+    min-width: 480px;
+    margin-bottom: 5px;
+    padding: 0 10px;
+    display: flex;
+    justify-content: space-between;
   }
+}
 </style>

+ 1 - 12
src/components/addDoc/getCode.vue

@@ -9,6 +9,7 @@
     @close="cancel"
     title="申请编码"
     :maxable="true"
+    :resizable="true"
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="82px">
       <el-row :gutter="15">
@@ -62,7 +63,6 @@
 
 <script>
   import { selectTreeList, listParentId, getCode } from './api';
-  import headerTitle from '@/components/header-title/index.vue';
 
   export default {
     data() {
@@ -91,7 +91,6 @@
       }
     },
     components: {
-      headerTitle
     },
     created() {},
     methods: {
@@ -121,16 +120,6 @@
       },
       async type1Change(val) {
         this.form.code = await getCode(val);
-        // let data = await pageSegment({
-        //   pageNum: 1,
-        //   size: 100,
-        //   businessCodeCategoryId: val
-        // });
-        // data.list.map((item) =>{
-        //   console.log(item,'dsds')
-        // });
-        // console.log(code, 'ds');
-        // this.options = data.list.map((item) => item.type == 2);
       },
       /* 保存编辑 */
       save() {

+ 1 - 2
src/components/addDoc/index.vue

@@ -47,7 +47,7 @@
       },
       size: {
         type: String,
-        default: ''
+        default: 'mini'
       }
     },
     data() {
@@ -58,7 +58,6 @@
     watch: {
       value: {
         handler(newVal) {
-          console.log(newVal, '=======');
           this.selectVal = newVal || [];
         },
         immediate: true

+ 2 - 0
src/components/addDoc/main.vue

@@ -7,6 +7,7 @@
     append-to-body
     ref="Emodal"
     :maxable="true"
+    :resizable="true"
   >
     <!-- 数据表格 -->
     <ele-pro-table
@@ -62,6 +63,7 @@
       custom-class="ele-dialog-form"
       append-to-body
       :maxable="true"
+    :resizable="true"
     >
       <doc_template
         :disabledTableList="tableList"

+ 2 - 2
src/components/addDoc/util.js

@@ -1,6 +1,6 @@
 import store from '@/store';
-const userId = store.state.user.info.userId
-const userName = store.state.user.info.name
+const userId = store.state.user?.info?.userId
+const userName = store.state.user?.info?.name
 export function isPower(data = {}, power, selection = []) {
 
     if (power == 'add' && data.userAuthority.length == 0) { //文件夹默认开放新增权限

+ 4 - 3
src/main.js

@@ -19,6 +19,7 @@ import TinymceEditor from '@/components/TinymceEditor/index.vue';
 import HeaderTitle from '@/components/header-title';
 import authSelection from '@/components/authSelection';
 import permissionccc from '@/utils/permissionccc.js';
+import fileMain from '@/components/addDoc/index.vue';
 
 Vue.directive('permissionccc', permissionccc);
 Vue.component('HeaderTitle', HeaderTitle);
@@ -59,7 +60,7 @@ Vue.prototype.$handleInputPublic = handleInputPublic;
 
 Vue.component('DictSelection', DictSelection);
 Vue.config.productionTip = false;
-
+  Vue.component('fileMain', fileMain);
 // 表单重置
 Vue.prototype.resetForm = function resetForm(refName) {
   if (this.$refs[refName]) {
@@ -87,8 +88,8 @@ Vue.use(VueClipboard);
 let instance = null;
 
 function render(props = {}) {
-  const { container, routerBase, fileMain } = props;
-  Vue.component('fileMain', fileMain);
+  const { container, routerBase } = props;
+
   // const router = new VueRouter({
   //   base: window.__POWERED_BY_QIANKUN__ ? routerBase : process.env.BASE_URL,
   //   mode: 'history',

+ 0 - 1
src/views/documentManagement/certificateManagement/index.vue

@@ -117,7 +117,6 @@
   import { getImageUrl } from '@/utils/file.js';
   import { deepClone } from '@/utils';
   import { holderTypeOptions } from '@/enum/dict.js';
-  // import fileMain from '@/components/addDoc/index.vue';
   import { reviewStatus } from '@/enum/dict';
 
   export default {