Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

lucw 10 месяцев назад
Родитель
Сommit
fd622e53c6

+ 10 - 7
src/components/addDoc/api/index.js

@@ -91,8 +91,10 @@ export async function pageSegment(data) {
 }
 
 // 生成编码
-export async function getCode(data) {
-  const res = await request.post(`/main/business_code_category/applyForCode`,data);
+export async function getCode(id) {
+  const res = await request.get(
+    `/main/business_code_category/applyForCode/` + id
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -114,13 +116,14 @@ export async function uploadFileNew(data) {
   return Promise.reject(new Error(res.data.message));
 }
 // 编码方案
-export async function listCode(data={}) {
-  console.log(data?.parentId,'data?.parentId')
-   
-  const res = await request.get(`/main/business_code_category/listCode/${data.id||'0'}`+'?parentId='+(data.parentId||''));
+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));
 }
-

+ 42 - 41
src/components/addDoc/browse.vue

@@ -18,48 +18,49 @@
 </template>
 
 <script>
-  import { getFileType } from './util.js';
+import { getFileType } from './util.js';
 
-  export default {
-    data() {
-      return {
-        fileUrl: '',
-        showEditFlag: false
-      };
-    },
-
-    methods: {
-      open(row) {
-        this.showEditFlag = true;
-        this.setFileUrl(row);
-      },
-      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);
+export default {
+  data() {
+    return {
+      fileUrl: '',
+      showEditFlag: false
+    };
+  },
 
-        // 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);
-        // }
-      }
+  methods: {
+    open(row){
+      this.showEditFlag=true
+      this.setFileUrl(row)
+    },
+    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">
+:deep(.el-dialog__headerbtn .el-dialog__close) {
+  color: #000;
+  font-size: 18px;
+  font-weight: 800;
+}
+</style>

+ 5 - 4
src/components/addDoc/doc_template.vue

@@ -69,7 +69,7 @@ export default {
       loading: true,
       // 列表数据
       data: [],
-      fileType:0,
+      // fileType:0,
       // 选中数据
       current: {}
     };
@@ -86,15 +86,16 @@ export default {
     ...mapGetters(['user'])
   },
   created() {
-    this.query();
+    // this.query();
   },
 
   methods: {
     /* 查询 */
-    async query() {
+    // 0:公司 1:个人
+    async query(type) {
       this.loading = true;
       let query = {
-        type: this.fileType,
+        type,
         currentUserId: this.user.info.userId
       };
       this.data = await getDocTreeListAPI(query);

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

@@ -27,178 +27,172 @@
 </template>
 
 <script>
-  import { filePageAPI } from './api';
-  import browse from './browse.vue';
-  import { setFileUrl } from './util.js';
+import { filePageAPI } from './api';
+import browse from './browse.vue';
 
-  export default {
-    components: { browse },
-    props: {
-      // 上级
-      parentData: {
-        type: Object,
-        default: () => {}
-      },
-
-      disabledTableList: {
-        //已选择列表
-        default: () => []
-      },
-      isQueryAll: {
-        //查看全部
-        default: 1
-      }
+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,
-          isQueryAll: this.isQueryAll
-        });
-      },
-      /* 刷新表格 */
-      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) {
-        window.open(setFileUrl(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>

+ 15 - 84
src/components/addDoc/getCode.vue

@@ -8,6 +8,8 @@
     append-to-body
     @close="cancel"
     title="申请编码"
+    :maxable="true"
+    :resizable="true"
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="82px">
       <el-row :gutter="15">
@@ -49,39 +51,9 @@
             <el-input v-model="form.code" disabled></el-input>
           </el-form-item>
         </el-col>
-
-        <el-col :span="24">
-          <headerTitle title="编码码段"></headerTitle>
-          <template v-for="item in segmentList">
-            <el-form-item :label="item.name" :prop="item.id" :key="item.id">
-              <el-input
-                v-if="item.roughRule == 5 || item.roughRule == 4"
-                :disabled="true"
-                v-model="item.currentValue"
-              ></el-input>
-              <el-select
-                v-else
-                v-model="item.currentValue"
-                placeholder="请选择"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="(segmentValue, index) in item.value"
-                  :key="index"
-                  :label="segmentValue.value"
-                  :value="segmentValue.value"
-                  @click.native="
-                    segmentValueChange(item.id, segmentValue.value, index)
-                  "
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </template>
-        </el-col>
       </el-row>
     </el-form>
-
+    <headerTitle title="编码码段"></headerTitle>
     <template v-slot:footer>
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="save"> 确认 </el-button>
@@ -90,13 +62,7 @@
 </template>
 
 <script>
-  import {
-    selectTreeList,
-    listParentId,
-    pageSegment,
-    getCode
-  } from './api/index.js';
-  import headerTitle from '@/components/header-title/index.vue';
+  import { selectTreeList, listParentId, getCode } from './api';
 
   export default {
     data() {
@@ -108,26 +74,28 @@
         },
         list: [],
         options: [],
-        segmentList: [],
         // 表单数据
         form: {
           type: '',
           code: '',
           type1: ''
         },
-        nodeData: null,
+
         showEditFlag: false
       };
     },
-    computed: {},
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
     components: {
-      headerTitle
     },
     created() {},
     methods: {
-      async open(nodeData) {
+      async open() {
         this.list = await selectTreeList();
-        this.nodeData = nodeData;
         this.setTree(this.list);
         this.showEditFlag = true;
       },
@@ -141,65 +109,28 @@
           }
         });
       },
-
       async typeChange(val) {
         let data = await listParentId({
           pageNum: 1,
           size: 100,
-          parentId: val,
-          objId: this.nodeData?.id,
-          objParentId: this.nodeData?.parentId
+          parentId: val
         });
         this.options = data.list.filter((item) => item.type == 2);
         this.form.type1 = '';
-        this.form.code = '';
-        this.segmentList = [];
       },
       async type1Change(val) {
-        let codeData = await getCode({
-          categoryId: val
-        });
-        this.form.code = codeData.codeStr;
-
-        let data = await pageSegment({
-          pageNum: 1,
-          size: 100,
-          businessCodeCategoryId: val
-        });
-        this.segmentList = data.list.map((item, index) => {
-          item['currentValue'] = codeData.values[index];
-          return item;
-        });
-      },
-      async segmentValueChange() {
-        // codeManageId:id,
-        //   code:value,
-        let codeData = await getCode({
-          categoryId: this.form.type1,
-
-          codeManageArray: this.segmentList.map((item) => {
-            return {
-              codeManageId: item.id,
-              code: item.currentValue
-            };
-          }),
-          isUpdateNo: 1
-        });
-        this.form.code = codeData.codeStr;
+        // this.form.code = await getCode(val);
       },
       /* 保存编辑 */
       save() {
-        this.$emit('setCode', this.form.code);
+        this.$emit('success', this.form.code);
         this.cancel();
       },
 
       cancel() {
         this.form.type = '';
         this.form.code = '';
-        this.form.type1 = '';
         this.showEditFlag = false;
-        this.segmentList = [];
-        this.options = [];
       }
     }
   };

+ 12 - 8
src/components/addDoc/main.vue

@@ -20,9 +20,12 @@
     >
       <template v-slot:toolbar v-if="type != 'view'">
         <el-button type="primary" @click="fileEditOpen">本地上传</el-button>
-        <el-button type="primary" @click="fileShow = true">
+        <el-button type="primary" @click="openFileList(0)">
           关联文档库
         </el-button>
+        <el-button type="primary" @click="openFileList(1)">
+          关联个人文档库
+        </el-button>
       </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
@@ -83,7 +86,6 @@
   import fileEdit from './file-edit.vue';
   import browse from './browse.vue';
   import { queryIds } from './api';
-  import { setFileUrl } from './util.js';
 
   export default {
     components: { doc_template, fileEdit, browse },
@@ -177,6 +179,12 @@
         }
         this.init();
       },
+      openFileList(type) {
+        this.fileShow = true;
+        this.$nextTick(() => {
+          this.$refs.doc_templateRef.query(type)
+        })
+      },
       fileEditOpen() {
         this.$refs.fileEditRef.open();
       },
@@ -186,11 +194,7 @@
       },
       async init() {
         if (this.fileId.length > 0) {
-          if (typeof this.fileId[0] == 'object') {
-            this.tableList = [];
-          } else {
-            this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
-          }
+          this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
         } else {
           this.tableList = [];
         }
@@ -200,7 +204,7 @@
         this.init();
       },
       browseOpen(row) {
-        window.open(setFileUrl(row));
+        this.$refs.browseRef.open(row);
       },
       addFile() {
         this.$emit(

+ 55 - 112
src/components/addDoc/util.js

@@ -1,122 +1,65 @@
 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) {
-    //文件夹默认开放新增权限
-    return true;
-  }
-  if (!data?.id && selection.length == 0) {
-    return false;
-  }
-  if (power == 'checkEnter' && data?.checkOutUserId != userId) {
-    //检入特殊处理
-    return false;
-  }
-  if (selection.length > 0) {
-    //多选情况处理
-    let isPower = true;
-    let userAuthorityS = [];
-    let createUserIdS = selection
-      .map((item) => item.createUserId)
-      .filter((createUserId) => createUserId == userId);
-    if (createUserIdS.length == selection.length || userName == 'admin') {
-      return true;
+
+    if (power == 'add' && data.userAuthority.length == 0) { //文件夹默认开放新增权限
+        return true
     }
-    selection.forEach((val) => {
-      const powerObj = val.userAuthority.find((item) => item.id == userId);
-      if (powerObj) {
-        userAuthorityS.push(powerObj);
-      }
-    });
+    if (!data?.id && selection.length == 0) {
+        return false
 
-    if (userAuthorityS.length == 0) {
-      isPower = false;
     }
-    userAuthorityS.forEach((item) => {
-      if (item[power] != '1') {
-        isPower = false;
-      }
-    });
-    return isPower;
-  }
+    if (power == 'checkEnter' && data?.checkOutUserId != userId) { //检入特殊处理
+        return false
+    }
+    if (selection.length > 0) { //多选情况处理
+        let isPower = true
+        let userAuthorityS = []
+        let createUserIdS = selection.map(item => item.createUserId).filter(createUserId => createUserId == userId)
+        if (createUserIdS.length == selection.length || userName == 'admin') {
+            return true
+        }
+        selection.forEach(val => {
+            const powerObj = val.userAuthority.find(item => item.id == userId)
+            if (powerObj) {
+                userAuthorityS.push(powerObj)
+            }
+        })
 
-  if (data.createUserId == userId || userName == 'admin') {
-    //创建人/admin所有权限
-    return true;
-  }
-  if (!power) {
-    return false;
-  }
-  const powerObj = data.userAuthority.find((item) => item.id == userId);
-  if (powerObj) {
-    return powerObj[power] == '1';
-  }
-}
-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 setFolderList(data) {
-  //递归过滤文件夹权限
-  data.forEach((item) => {
-    item['disabled'] = !isPower(item, 'add');
-    if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
-      setFolderList(item.sonDirectoryList);
+        if (userAuthorityS.length == 0) {
+            isPower = false
+        }
+        userAuthorityS.forEach(item => {
+            if (item[power] != '1') {
+                isPower = false
+            }
+        })
+        return isPower
+    }
+
+    if (data.createUserId == userId || userName == 'admin') { //创建人/admin所有权限
+        return true
+    }
+    if (!power) {
+        return false
+    }
+    const powerObj = data.userAuthority.find(item => item.id == userId)
+    if (powerObj) {
+
+        return powerObj[power] == '1'
     }
-  });
+}
+
+export function setFolderList(data) { //递归过滤文件夹权限
+    data.forEach((item) => {
+        item['disabled'] = !isPower(item, 'add');
+        if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
+            setFolderList(item.sonDirectoryList);
+        }
+    });
 }
 //新迪预览工具支持的文件格式
 export function getFileType() {
-  return [
-    'par',
-    'asm',
-    'psm',
-    'dft',
-    'sldprt',
-    'sldasm',
-    'ipt',
-    'iam',
-    'prt',
-    '3dxml',
-    'CATPart',
-    'CATProduct',
-    'cgr',
-    'model',
-    'exp',
-    'session',
-    'x_t',
-    'xmt_txt',
-    'x_b',
-    'xmp_bin',
-    'xmp_txt',
-    'sat',
-    'sab',
-    'igs',
-    'iges',
-    'stp',
-    'step',
-    'jt',
-    'xcgm',
-    '3dm',
-    'stl',
-    'obj',
-    '3mf',
-    'fbx',
-    'vda',
-    'dxf',
-    'dwg',
-    'pdf',
-    'idf',
-    'idb',
-    'emn',
-    'brd'
-  ];
-}
+    return ['par', 'asm', 'psm', 'dft', 'sldprt', 'sldasm', 'ipt', 'iam', 'prt', '3dxml', 'CATPart', 'CATProduct', 'cgr', 'model', 'exp', 'session', 'x_t', 'xmt_txt', 'x_b', 'xmp_bin', 'xmp_txt', 'sat', 'sab', 'igs', 'iges', 'stp', 'step', 'jt', 'xcgm', '3dm', 'stl', 'obj', '3mf', 'fbx', 'vda', 'dxf', 'dwg', 'pdf', 'idf', 'idb', 'emn', 'brd']
+}

+ 126 - 0
src/components/addDoc1/api/index.js

@@ -0,0 +1,126 @@
+import request from '@/utils/request';
+
+/**
+ * 查询文件夹分类数据
+ * @data data
+ */
+export async function getDocTreeListAPI(data) {
+  const res = await request.post('/fm/directory/selectTreeList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 查询文件数据
+ * @data data
+ */
+export async function filePageAPI(data) {
+  const res = await request.post('/fm/file/pageBusiness', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 保存
+ * @data data
+ */
+export async function fileSaveAPI(data) {
+  const res = await request.post('/fm/file/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 详情
+ * @id id
+ */
+export async function fileGetByIdAPI(id) {
+  const res = await request.get(`/fm/file/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * ids查询文件列表
+ * @data data
+ */
+export async function queryIds(data) {
+  const res = await request.post('/fm/file/queryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取编码树
+export async function selectTreeList(data) {
+  const res = await request.post(
+    `/main/business_code_category/selectTreeList`,
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 获取右侧列表
+export async function listParentId(data) {
+  const res = await request.post(
+    `/main/business_code_category/listPageParentId`,
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 获取右侧码段列表
+export async function pageSegment(data) {
+  const res = await request.post(`/main/business_code_manage/page`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 生成编码
+export async function getCode(data) {
+  const res = await request.post(`/main/business_code_category/applyForCode`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 上传文件
+ * @param file 文件
+ */
+export async function uploadFileNew(data) {
+  const formData = new FormData();
+  formData.append('multiPartFile', data.multiPartFile);
+  formData.append('module', data.module);
+  const res = await request.post('/main/file/uploadFile', formData);
+  if (res.data.code === '0') {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 编码方案
+export async function listCode(data={}) {
+  console.log(data?.parentId,'data?.parentId')
+   
+  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));
+}
+

+ 65 - 0
src/components/addDoc1/browse.vue

@@ -0,0 +1,65 @@
+<template>
+  <ele-modal
+    :visible.sync="showEditFlag"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    append-to-body
+    :fullscreen="true"
+  >
+    <iframe
+      :src="fileUrl"
+      width="100%"
+      v-if="showEditFlag"
+      style="height: calc(100vh - 100px)"
+      frameborder="0"
+      allowfullscreen="true"
+    ></iframe
+  ></ele-modal>
+</template>
+
+<script>
+  import { getFileType } from './util.js';
+
+  export default {
+    data() {
+      return {
+        fileUrl: '',
+        showEditFlag: false
+      };
+    },
+
+    methods: {
+      open(row) {
+        this.showEditFlag = true;
+        this.setFileUrl(row);
+      },
+      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>

+ 176 - 0
src/components/addDoc1/doc_template.vue

@@ -0,0 +1,176 @@
+<template>
+  <div class="ele-body" style="height:60vh;overflow: auto;">
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="210px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <!-- 操作按钮 -->
+          <ele-toolbar class="ele-toolbar-actions">
+            <div style="margin: 5px 0"> </div>
+          </ele-toolbar>
+             
+          <div class="ele-border-lighter sys-organization-list"  style="height: 65vh">
+            <el-tree
+              ref="tree"
+              :data="data"
+              highlight-current
+              :draggable="true"
+              node-key="id"
+              :props="{ label: 'name', children: 'sonDirectoryList' }"
+              :expand-on-click-node="false"
+              :default-expand-all="true"
+              @node-click="onNodeClick"
+            >
+              <span class="custom-tree-node" slot-scope="{ node, data }">
+                <ElementTreeLine
+                  :node="node"
+                  :showLabelLine="true"
+                  :indent="20"
+                >
+                  <img src="../../assets/wjj.png" />
+
+                  <span>{{ node.label }}</span>
+                </ElementTreeLine>
+              </span>
+            </el-tree>
+          </div>
+        </div>
+        <template v-slot:content>
+          <FileTableList
+            ref="tableRef"
+            :parentData="current"
+            :disabledTableList="disabledTableList"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <!-- {{current?.id}} -->
+  </div>
+</template>
+
+<script>
+//
+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 },
+
+  data() {
+    return {
+      loading: true,
+      // 列表数据
+      data: [],
+      fileType:0,
+      // 选中数据
+      current: {}
+    };
+  },
+  props: {
+    lcyStatus: '', //1:文档工作区 2:文档归档区 3:文档发布区 4:文档废止区
+
+    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);
+
+      this.current = null;
+      this.$nextTick(() => {
+        this.$refs.tree.setCurrentKey(this.data[0].id);
+
+        this.onNodeClick(this.data[0]);
+      });
+      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();
+    }
+  }
+};
+</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 :deep(.el-tree-node__content) {
+  height: 30px;
+
+  & > .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;
+// }
+</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>

+ 329 - 0
src/components/addDoc1/file-edit.vue

@@ -0,0 +1,329 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    width="500px"
+    :visible.sync="showEditFlag"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    append-to-body
+    @close="cancel"
+    :title="title"
+    ref="Emodal"
+    :maxable="true"
+    :resizable="true"
+  >
+    <el-tabs
+      v-model="activeName"
+      type="card"
+      @tab-click="handleClick"
+      style="margin-bottom: 10px"
+    >
+      <el-tab-pane label="文档工作区" name="1"></el-tab-pane>
+      <el-tab-pane label="个人文档" name="2"></el-tab-pane>
+    </el-tabs>
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col :span="24">
+          <el-form-item label="文档位置" prop="directoryId">
+            <el-cascader
+              style="width: 100%"
+              v-model="form.directoryId"
+              :options="folderList"
+              @change="initFileCode"
+              ref="cascaderRef"
+              :props="{
+                value: 'id',
+                label: 'name',
+                children: 'sonDirectoryList',
+                emitPath: false,
+                checkStrictly: true
+              }"
+            ></el-cascader>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="编码分类" prop="codeType">
+            <ele-tree-select
+              clearable
+              :data="list"
+              v-model="form.codeType"
+              placeholder="请选择"
+              default-expand-all
+              labelKey="name"
+              childrenKey="sonDirectoryList"
+              valueKey="id"
+              @change="typeChange"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="编码方案" prop="businessCodeId">
+            <el-select
+              v-model="form.businessCodeId"
+              placeholder="请选择"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="文档类型" prop="type">
+            <DictSelection
+              dictName="文档类型"
+              v-model="form.type"
+            ></DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="文档" prop="storagePath">
+            <div style="display: flex; align-items: center">
+              <fileUpload
+                v-model="form.storagePath"
+                module="main"
+                :limit="100"
+                :multiple="true"
+                @fileChange="fileChange"
+              >
+              </fileUpload>
+            </div>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              v-model="form.remark"
+              type="textarea"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        确认
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import {
+    fileSaveAPI,
+    selectTreeList,
+    listParentId,
+    getDocTreeListAPI,
+    listCode
+  } from './api/index';
+  import FileUpload from './fileUpload.vue';
+  import { setFolderList } from './util.js';
+  import { mapGetters } from 'vuex';
+  export default {
+    components: { FileUpload },
+
+    data() {
+      const defaultForm = {
+        name: '', //名称
+        type: '1', //类型
+        sizeUnit: '', //大小,
+        unit: '', //单位
+        remark: '', //备注
+        status: '', //状态
+        storagePathId: '',
+        directoryId: '',
+        businessCodeId: '',
+        storagePath: [],
+        id: '',
+        lcyStatus: 1,
+        fileType: 0
+      };
+      return {
+        activeName: '1',
+        rules: {
+          businessCodeId: [
+            { required: true, message: '请选择', trigger: 'blur' }
+          ],
+          // codeType: [{ required: true, message: '请选择', trigger: 'blur' }],
+          directoryId: [{ required: true, message: '请选择', trigger: 'blur' }],
+          storagePath: [{ required: true, message: '请选择', trigger: 'blur' }]
+        },
+        templateVisible: false,
+        folderList: [],
+        allFolderList: [],
+        myFolderList: [],
+        list: [],
+        options: [],
+        defaultForm,
+        code: '',
+        // 表单数据
+        form: { ...defaultForm },
+
+        // 提交状态
+        loading: false,
+        showEditFlag: false,
+        title: '',
+        type: '新建附件',
+        nodeData: {}
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      },
+      ...mapGetters(['user'])
+    },
+    async created() {
+      this.allFolderList = await getDocTreeListAPI({
+        type: 0,
+        currentUserId: this.user.info.userId
+      });
+      this.myFolderList = await getDocTreeListAPI({
+        type: 1,
+        currentUserId: this.user.info.userId
+      });
+      this.folderList = this.allFolderList;
+      setFolderList(this.folderList); //权限过滤
+    },
+    methods: {
+      handleClick() {
+        this.form.directoryId = '';
+        this.form.businessCodeId = '';
+        this.form.codeType = '';
+        if (this.activeName == 2) {
+          this.folderList = this.myFolderList;
+        } else {
+          this.folderList = this.allFolderList;
+        }
+      },
+      async getTreeCode() {
+        let nodeData = {};
+        await this.$nextTick(() => {
+          // console.log(this.$refs,'this.$refs')
+          nodeData =
+            this.$refs.cascaderRef && this.$refs.cascaderRef.getCheckedNodes();
+        });
+        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.nodeData.id ? await listCode(this.nodeData) : [];
+        if (this.options.length > 0) {
+          this.form.businessCodeId = this.options[0].id;
+          this.form.codeType = this.options[0].parentId;
+        } else {
+          this.form.businessCodeId = '';
+        }
+      },
+      async open() {
+        this.showEditFlag = true;
+        this.$nextTick(async () => {
+          this.list = await selectTreeList();
+          await this.initFileCode();
+          this.setTree(this.list);
+        });
+      },
+
+      setTree(data) {
+        data.forEach((item) => {
+          item.sonDirectoryList = item.sonDirectoryList.filter(
+            (item) => item.type == 1
+          );
+          if (item.sonDirectoryList.length > 0) {
+            this.setTree(item.sonDirectoryList);
+          }
+        });
+      },
+      async typeChange(val) {
+        let obj = {
+          pageNum: 1,
+          size: 100,
+          parentId: val
+        };
+        if (this.activeName == 1) {
+          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 = '';
+      },
+
+      fileChange(file) {
+        this.form.name = file.name.replace(/\.[^/.]+$/, '');
+      },
+
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate(async (valid) => {
+          if (!valid) {
+            return false;
+          }
+
+          let data = {
+            ...this.form
+          };
+          if (this.activeName == 2) {
+            data.fileType = 1;
+          }
+          this.loading = true;
+          fileSaveAPI(data)
+            .then((msg) => {
+              this.loading = false;
+
+              this.cancel();
+              this.$emit('done', msg);
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      },
+
+      cancel() {
+        this.form = { ...this.defaultForm, directoryId: this.form.directoryId };
+        this.$refs.form.clearValidate();
+        this.showEditFlag = false;
+      }
+    }
+  };
+</script>
+<style scoped lang="scss">
+  .aaa {
+    width: 100%;
+
+    ::v-deep .upload-demo {
+      width: 100%;
+
+      .el-upload--text {
+        width: 100%;
+
+        button {
+          width: 100%;
+          background: #ffffff;
+          border: 1px solid #dbdbdb;
+          border-radius: 5px;
+        }
+      }
+
+      .el-upload-list {
+        transform: translate(10px, -39px);
+        position: absolute;
+      }
+    }
+  }
+</style>

+ 204 - 0
src/components/addDoc1/file-table-listTemplate.vue

@@ -0,0 +1,204 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      tool-class="ele-toolbar-form"
+      row-key="id"
+      :selection.sync="selection"
+      :toolbar="false"
+    >
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="browseOpen(row)"
+        >
+          浏览
+        </el-link>
+      </template>
+    </ele-pro-table>
+    <browse ref="browseRef"></browse>
+  </div>
+</template>
+
+<script>
+  import { filePageAPI } from './api';
+  import browse from './browse.vue';
+  import { setFileUrl } from './util.js';
+
+  export default {
+    components: { browse },
+    props: {
+      // 上级
+      parentData: {
+        type: Object,
+        default: () => {}
+      },
+
+      disabledTableList: {
+        //已选择列表
+        default: () => []
+      },
+      isQueryAll: {
+        //查看全部
+        default: 1
+      }
+    },
+
+    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',
+
+            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,
+          isQueryAll: this.isQueryAll
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+      getTableList() {
+        return JSON.parse(JSON.stringify(this.selection));
+      }
+    }
+  };
+</script>

+ 262 - 0
src/components/addDoc1/fileUpload.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="upload-file">
+    <el-upload
+      class="upload-demo"
+      action="#"
+      v-loading="loading"
+      element-loading-text="上传中"
+      :http-request="handlRequest"
+      :before-remove="beforeRemove"
+      :on-remove="handleRemove"
+      :on-preview="handleItem"
+      :multiple="multiple"
+      :before-upload="beforeUpload"
+      :file-list="fileList"
+      :show-file-list="!showLib"
+      :disabled="disabled"
+    >
+      <!-- <slot>
+        <el-button :disabled="disabled" type="primary" icon="el-icon-plus" size="mini">点击上传</el-button>
+      </slot> -->
+      <el-button
+        slot="trigger"
+        :disabled="disabled"
+        type="primary"
+        icon="el-icon-plus"
+        size="mini"
+        >点击上传</el-button
+      >
+      <slot name="templateBtn"> </slot>
+    </el-upload>
+  </div>
+</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
+    }
+  },
+  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'
+        }
+      ]
+    };
+  },
+  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;
+        });
+        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();
+    }
+    // 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;
+
+  .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;
+  }
+}
+</style>

+ 231 - 0
src/components/addDoc1/getCode.vue

@@ -0,0 +1,231 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    width="500px"
+    :visible.sync="showEditFlag"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    append-to-body
+    @close="cancel"
+    title="申请编码"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col :span="24">
+          <el-form-item label="编码分类" prop="type">
+            <ele-tree-select
+              clearable
+              :data="list"
+              v-model="form.type"
+              placeholder="请选择"
+              default-expand-all
+              labelKey="name"
+              childrenKey="sonDirectoryList"
+              valueKey="id"
+              @change="typeChange"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="编码方案" prop="type1">
+            <el-select
+              v-model="form.type1"
+              placeholder="请选择"
+              style="width: 100%"
+              @change="type1Change"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="编码预览" prop="code">
+            <el-input v-model="form.code" disabled></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <headerTitle title="编码码段"></headerTitle>
+          <template v-for="item in segmentList">
+            <el-form-item :label="item.name" :prop="item.id" :key="item.id">
+              <el-input
+                v-if="item.roughRule == 5 || item.roughRule == 4"
+                :disabled="true"
+                v-model="item.currentValue"
+              ></el-input>
+              <el-select
+                v-else
+                v-model="item.currentValue"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="(segmentValue, index) in item.value"
+                  :key="index"
+                  :label="segmentValue.value"
+                  :value="segmentValue.value"
+                  @click.native="
+                    segmentValueChange(item.id, segmentValue.value, index)
+                  "
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="save"> 确认 </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import {
+    selectTreeList,
+    listParentId,
+    pageSegment,
+    getCode
+  } from './api/index.js';
+  import headerTitle from '@/components/header-title/index.vue';
+
+  export default {
+    data() {
+      return {
+        rules: {
+          type: [{ required: true, message: '请选择', trigger: 'blur' }],
+          type1: [{ required: true, message: '请选择', trigger: 'blur' }],
+          code: [{ required: true, message: '请申请', trigger: 'blur' }]
+        },
+        list: [],
+        options: [],
+        segmentList: [],
+        // 表单数据
+        form: {
+          type: '',
+          code: '',
+          type1: ''
+        },
+        nodeData: null,
+        showEditFlag: false
+      };
+    },
+    computed: {},
+    components: {
+      headerTitle
+    },
+    created() {},
+    methods: {
+      async open(nodeData) {
+        this.list = await selectTreeList();
+        this.nodeData = nodeData;
+        this.setTree(this.list);
+        this.showEditFlag = true;
+      },
+      setTree(data) {
+        data.forEach((item) => {
+          item.sonDirectoryList = item.sonDirectoryList.filter(
+            (item) => item.type == 1
+          );
+          if (item.sonDirectoryList.length > 0) {
+            this.setTree(item.sonDirectoryList);
+          }
+        });
+      },
+
+      async typeChange(val) {
+        let data = await listParentId({
+          pageNum: 1,
+          size: 100,
+          parentId: val,
+          objId: this.nodeData?.id,
+          objParentId: this.nodeData?.parentId
+        });
+        this.options = data.list.filter((item) => item.type == 2);
+        this.form.type1 = '';
+        this.form.code = '';
+        this.segmentList = [];
+      },
+      async type1Change(val) {
+        let codeData = await getCode({
+          categoryId: val
+        });
+        this.form.code = codeData.codeStr;
+
+        let data = await pageSegment({
+          pageNum: 1,
+          size: 100,
+          businessCodeCategoryId: val
+        });
+        this.segmentList = data.list.map((item, index) => {
+          item['currentValue'] = codeData.values[index];
+          return item;
+        });
+      },
+      async segmentValueChange() {
+        // codeManageId:id,
+        //   code:value,
+        let codeData = await getCode({
+          categoryId: this.form.type1,
+
+          codeManageArray: this.segmentList.map((item) => {
+            return {
+              codeManageId: item.id,
+              code: item.currentValue
+            };
+          }),
+          isUpdateNo: 1
+        });
+        this.form.code = codeData.codeStr;
+      },
+      /* 保存编辑 */
+      save() {
+        this.$emit('setCode', this.form.code);
+        this.cancel();
+      },
+
+      cancel() {
+        this.form.type = '';
+        this.form.code = '';
+        this.form.type1 = '';
+        this.showEditFlag = false;
+        this.segmentList = [];
+        this.options = [];
+      }
+    }
+  };
+</script>
+<style scoped lang="scss">
+  .aaa {
+    width: 100%;
+
+    ::v-deep .upload-demo {
+      width: 100%;
+
+      .el-upload--text {
+        width: 100%;
+
+        button {
+          width: 100%;
+          background: #ffffff;
+          border: 1px solid #dbdbdb;
+          border-radius: 5px;
+        }
+      }
+
+      .el-upload-list {
+        transform: translate(10px, -39px);
+        position: absolute;
+      }
+    }
+  }
+</style>

+ 78 - 0
src/components/addDoc1/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <el-badge :value="value.length" class="item">
+      <el-button
+        icon="el-icon-plus"
+        v-if="type != 'view'"
+        type="primary"
+        @click="handleUpload"
+        :size="size"
+      >
+        上传</el-button
+      >
+      <el-button
+        icon="el-icon-view"
+        v-else
+        type="primary"
+        @click="handleUpload"
+      >
+        查看</el-button
+      >
+    </el-badge>
+
+    <file-upload @success="getFiles" ref="fileUploadRef"></file-upload>
+  </div>
+</template>
+
+<script>
+  import fileUpload from './main.vue';
+
+  export default {
+    name: 'index',
+    components: { fileUpload },
+    model: {
+      prop: 'value',
+      event: 'updateVal'
+    },
+    props: {
+      type: {
+        type: String,
+        default: ''
+      },
+      value: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      },
+      size: {
+        type: String,
+        default: 'mini'
+      }
+    },
+    data() {
+      return {
+        selectVal: ''
+      };
+    },
+    watch: {
+      value: {
+        handler(newVal) {
+          this.selectVal = newVal || [];
+        },
+        immediate: true
+      }
+    },
+    created() {},
+    methods: {
+      handleUpload() {
+        this.$refs.fileUploadRef.open(this.selectVal, this.type);
+      },
+      getFiles(val = []) {
+        this.$emit('updateVal', val);
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss"></style>

+ 223 - 0
src/components/addDoc1/main.vue

@@ -0,0 +1,223 @@
+<template>
+  <ele-modal
+    width="60%"
+    :visible.sync="showEditFlag"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    append-to-body
+    ref="Emodal"
+    :maxable="true"
+    :resizable="true"
+  >
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="tableList"
+      tool-class="ele-toolbar-form"
+      :needPage="false"
+      row-key="id"
+    >
+      <template v-slot:toolbar v-if="type != 'view'">
+        <el-button type="primary" @click="fileEditOpen">本地上传</el-button>
+        <el-button type="primary" @click="fileShow = true">
+          关联文档库
+        </el-button>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="browseOpen(row)"
+        >
+          浏览
+        </el-link>
+
+        <el-popconfirm
+          v-if="type != 'view'"
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <template v-slot:footer>
+      <el-button @click="showEditFlag = false">取消</el-button>
+      <el-button type="primary" @click="addFile" v-if="type != 'view'">
+        确认
+      </el-button>
+    </template>
+    <fileEdit ref="fileEditRef" @done="done"></fileEdit>
+    <ele-modal
+      width="80%"
+      :visible.sync="fileShow"
+      :close-on-click-modal="false"
+      custom-class="ele-dialog-form"
+      append-to-body
+      :maxable="true"
+      :resizable="true"
+    >
+      <doc_template
+        :disabledTableList="tableList"
+        ref="doc_templateRef"
+      ></doc_template>
+      <template v-slot:footer>
+        <el-button @click="fileShow = false">取消</el-button>
+        <el-button type="primary" @click="addTemplate"> 确认 </el-button>
+      </template>
+    </ele-modal>
+    <browse ref="browseRef"></browse>
+  </ele-modal>
+</template>
+
+<script>
+  import doc_template from './doc_template.vue';
+  import fileEdit from './file-edit.vue';
+  import browse from './browse.vue';
+  import { queryIds } from './api';
+  import { setFileUrl } from './util.js';
+
+  export default {
+    components: { doc_template, fileEdit, browse },
+
+    data() {
+      return {
+        fileId: [],
+        fileShow: false,
+        showEditFlag: false,
+        tableList: [],
+        type: 'add',
+        columns: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            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 && cellValue[0]?.name;
+            }
+          },
+          {
+            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
+          },
+
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
+    },
+    created() {},
+
+    methods: {
+      open(fileId, type) {
+        //查看详情:view 新增:add
+        this.showEditFlag = true;
+        this.fileId = fileId || [];
+        if (type) {
+          this.type = type;
+        }
+        this.init();
+      },
+      fileEditOpen() {
+        this.$refs.fileEditRef.open();
+      },
+      remove(row) {
+        this.tableList = this.tableList.filter((item) => item.code != row.code);
+        this.fileId = this.tableList.map((item) => item.id);
+      },
+      async init() {
+        if (this.fileId.length > 0) {
+          if (typeof this.fileId[0] == 'object') {
+            this.tableList = [];
+          } else {
+            this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+          }
+        } else {
+          this.tableList = [];
+        }
+      },
+      done(id) {
+        this.fileId.push(...id);
+        this.init();
+      },
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+      addFile() {
+        this.$emit(
+          'success',
+          this.tableList.map((item) => item.id)
+        );
+        this.showEditFlag = false;
+      },
+      addTemplate() {
+        let list = this.$refs.doc_templateRef.getTableList();
+        this.fileShow = false;
+        if (list.length == 0) {
+          this.$message.error('请选择一条数据');
+          return;
+        }
+        this.tableList.push(...list);
+      }
+    }
+  };
+</script>

+ 122 - 0
src/components/addDoc1/util.js

@@ -0,0 +1,122 @@
+import store from '@/store';
+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) {
+    //文件夹默认开放新增权限
+    return true;
+  }
+  if (!data?.id && selection.length == 0) {
+    return false;
+  }
+  if (power == 'checkEnter' && data?.checkOutUserId != userId) {
+    //检入特殊处理
+    return false;
+  }
+  if (selection.length > 0) {
+    //多选情况处理
+    let isPower = true;
+    let userAuthorityS = [];
+    let createUserIdS = selection
+      .map((item) => item.createUserId)
+      .filter((createUserId) => createUserId == userId);
+    if (createUserIdS.length == selection.length || userName == 'admin') {
+      return true;
+    }
+    selection.forEach((val) => {
+      const powerObj = val.userAuthority.find((item) => item.id == userId);
+      if (powerObj) {
+        userAuthorityS.push(powerObj);
+      }
+    });
+
+    if (userAuthorityS.length == 0) {
+      isPower = false;
+    }
+    userAuthorityS.forEach((item) => {
+      if (item[power] != '1') {
+        isPower = false;
+      }
+    });
+    return isPower;
+  }
+
+  if (data.createUserId == userId || userName == 'admin') {
+    //创建人/admin所有权限
+    return true;
+  }
+  if (!power) {
+    return false;
+  }
+  const powerObj = data.userAuthority.find((item) => item.id == userId);
+  if (powerObj) {
+    return powerObj[power] == '1';
+  }
+}
+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 setFolderList(data) {
+  //递归过滤文件夹权限
+  data.forEach((item) => {
+    item['disabled'] = !isPower(item, 'add');
+    if (item.sonDirectoryList && item.sonDirectoryList.length > 0) {
+      setFolderList(item.sonDirectoryList);
+    }
+  });
+}
+//新迪预览工具支持的文件格式
+export function getFileType() {
+  return [
+    'par',
+    'asm',
+    'psm',
+    'dft',
+    'sldprt',
+    'sldasm',
+    'ipt',
+    'iam',
+    'prt',
+    '3dxml',
+    'CATPart',
+    'CATProduct',
+    'cgr',
+    'model',
+    'exp',
+    'session',
+    'x_t',
+    'xmt_txt',
+    'x_b',
+    'xmp_bin',
+    'xmp_txt',
+    'sat',
+    'sab',
+    'igs',
+    'iges',
+    'stp',
+    'step',
+    'jt',
+    'xcgm',
+    '3dm',
+    'stl',
+    'obj',
+    '3mf',
+    'fbx',
+    'vda',
+    'dxf',
+    'dwg',
+    'pdf',
+    'idf',
+    'idb',
+    'emn',
+    'brd'
+  ];
+}

+ 1 - 0
src/views/documentManagement/certificateManagement/components/add-dialog.vue

@@ -347,6 +347,7 @@
         if (!val) return (this.form.processTypeName = '');
         let node = this.$refs.tree.$refs.tree.getCurrentNode();
         this.form.holderId = node.id;
+        this.form.holder = node.name;
       }
     }
   };

+ 58 - 54
src/views/documentManagement/certificateManagement/components/detail-dialog.vue

@@ -19,59 +19,61 @@
         </ul>
       </div>
     </div>
-    <el-descriptions title="" :column="3" size="medium" border
-    v-if="activeComp == 'main'"
-    >
-      <el-descriptions-item>
-        <template slot="label"> 证照编号 </template>
-        {{ form.code }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label"> 类型 </template>
-        {{
-          getDictValue(
-            form.holderType == 1 ? '证件类型' : '客户/供应商资质类型',
-            form.type
-          )
-        }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label"> 持证对象</template>
-        {{ form.holder }}
-      </el-descriptions-item>
-      <el-descriptions-item :span="2">
-        <template slot="label"> 有效期至 </template>
-        {{ form.validityStartTime + ' — ' + form.validityEndTime }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label"> 状态 </template>
-        {{ getDictValue('规则状态', form.status) }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label"> 颁发时间 </template>
-        {{ form.enactorTime }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label"> 创建人 </template>
-        {{ form.createUserName }}
-      </el-descriptions-item>
-      <!-- <el-descriptions-item>
-        <template slot="label"> 创建机构 </template>
-        {{ form.createUserDeptName }}
-      </el-descriptions-item> -->
-      <el-descriptions-item>
-        <template slot="label"> 创建时间 </template>
-        {{ form.createTime }}
-      </el-descriptions-item>
-      <el-descriptions-item :span="3">
-        <template slot="label"> 附件 </template>
-        <fileMain v-model="form.fileObj" type="view"></fileMain>
-      </el-descriptions-item>
-      <el-descriptions-item :span="3">
-        <template slot="label"> 备注 </template>
-        {{ form.remark }}
-      </el-descriptions-item>
-    </el-descriptions>
+    <div v-if="activeComp == 'main'">
+      <el-descriptions title="" :column="3" size="medium" border>
+        <el-descriptions-item>
+          <template slot="label"> 证照编号 </template>
+          {{ form.code }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 类型 </template>
+          {{
+            getDictValue(
+              form.holderType == 1 ? '证件类型' : '客户/供应商资质类型',
+              form.type
+            )
+          }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 持证对象</template>
+          {{ form.holder }}
+        </el-descriptions-item>
+        <el-descriptions-item :span="2">
+          <template slot="label"> 有效期至 </template>
+          {{ form.validityStartTime + ' — ' + form.validityEndTime }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 状态 </template>
+          {{ getDictValue('规则状态', form.status) }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 颁发时间 </template>
+          {{ form.enactorTime }}
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label"> 创建人 </template>
+          {{ form.createUserName }}
+        </el-descriptions-item>
+        <!-- <el-descriptions-item>
+          <template slot="label"> 创建机构 </template>
+          {{ form.createUserDeptName }}
+        </el-descriptions-item> -->
+        <el-descriptions-item>
+          <template slot="label"> 创建时间 </template>
+          {{ form.createTime }}
+        </el-descriptions-item>
+        <el-descriptions-item :span="3">
+          <template slot="label"> 附件 </template>
+          <fileMain v-model="form.fileObj" type="view"></fileMain>
+        </el-descriptions-item>
+        <el-descriptions-item :span="3">
+          <template slot="label"> 备注 </template>
+          {{ form.remark }}
+        </el-descriptions-item>
+      </el-descriptions>
+      <productTable ref="productTableRef" :isView="true" />
+    </div>
+    
     <bpmDetail
       v-if="activeComp == 'bpm' && form.processInstanceId"
       :id="form.processInstanceId"
@@ -87,10 +89,11 @@
   import dictMixins from '@/mixins/dictMixins';
   // import fileMain from '@/components/addDoc/index.vue';
   import bpmDetail from '@/views/bpm/processInstance/businessDetail.vue';
+  import productTable from './productTable.vue';
 
   export default {
     mixins: [dictMixins],
-    components: { bpmDetail },
+    components: { bpmDetail, productTable },
     //注册组件
     data() {
       return {
@@ -118,6 +121,7 @@
       async getInfo(id) {
         const data = await getPhotoInfo(id);
         this.form = data;
+        this.$refs.productTableRef.putTableValue(data.categorys || []);
       }
     }
   };

+ 16 - 10
src/views/documentManagement/certificateManagement/components/productTable.vue

@@ -6,20 +6,21 @@
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <el-button
-              size="small"
-              type="primary"
-              icon="el-icon-plus"
-              class="ele-btn-icon"
-              @click="handParent('', -1)"
-            >
-              新增
-            </el-button>
+          v-if="!isView"
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="handParent('', -1)"
+        >
+          新增
+        </el-button>
       </template>
       <!-- 操作列 -->
       <template v-slot:action="scope">
         <el-popconfirm  class="ele-action" title="确定要删除吗?" @confirm="remove(scope.$index)">
           <template v-slot:reference>
-            <el-link type="danger" :underline="false" icon="el-icon-delete">
+            <el-link v-if="!isView" type="danger" :underline="false" icon="el-icon-delete">
               删除
             </el-link>
           </template>
@@ -40,7 +41,12 @@
   import productList from './product-list.vue';
 
   export default {
-
+    props: {
+      isView: {
+        type: Boolean,
+        default: false
+      }
+    },
     components:{
         productList
     },

+ 1 - 1
src/views/system/parmasManage/search.vue

@@ -35,7 +35,7 @@
 
       <el-col
         style="display: flex; justify-content: flex-end"
-        v-bind="styleResponsive ? { lg: 12, md: 24 } : { span: 12 }"
+        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
       >
         <div class="ele-form-actions">
           <el-button