cyy 11 месяцев назад
Родитель
Сommit
25709a7617

+ 12 - 0
src/api/platform/feature/sqlInject.js

@@ -67,3 +67,15 @@ export function queryRem(data) {
     data
   })
 }
+
+/**
+ * 获取受控文件查阅信息
+ * @param {*} params
+ */
+export function queryFileInfo(params) {
+  return request({
+    url: BPMN_URL() + '/reform/queryWjxx',
+    method: 'get',
+    params
+  })
+}

+ 524 - 524
src/views/platform/bpmn/documents/documents.vue

@@ -104,343 +104,343 @@ import { Notify } from 'vant'
 const _ = require('lodash')
 
 export default {
-    components: {
-        IbpsMoreSearch,
-        IbpsTypeTree,
-        IbpsAvatar,
-        IbpsToolbar,
-        IbpsListResultPage,
-        IbpsBpmnFormrenderDialog,
-        LookDocument
-    },
-    mixins: [random, bpmnStatus],
-    data() {
-        const { userId, userList = [], deptList, menus, userInfo, role } = this.$store.getters
-        const depArrs = []
-        var fileDownloadAuthority = false
-        for (var i of deptList) {
-            depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
-        }
-        const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
-        for (const i of roleKey) {
-            if (role.some(so => { return so.alias === i })) {
-                fileDownloadAuthority = true
-                break
-            }
-        }
-        return {
-            categoryKey: '',
-            documentsSon: false,
-            sonData: '',
-            userId: userId,
-            footText: false,
-            showPop: false,
-            noData: false,
-            showConfirmationBoxList: true,
-            countTotal: {},
-            examPopup: '',
-            ReachBottomShow: false,
-            moreSearchPopup: false,
-            searchForms: {
-                forms: [
-                    // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
-                    //   { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
-                    { prop: 'examName', label: '考试名称', fieldType: 'text' },
-                    { prop: 'bankName', label: '题库名称', fieldType: 'text' },
-                    {
-                        prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
-                            { value: 'trainingExam', label: '培训考试' },
-                            { value: 'POCTtraining', label: 'POCT培训' },
-                            { value: 'selfAssessment', label: '自主考核' },
-                            { value: 'routine', label: '常规' }
-                        ]
-                    },
-                    { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
-                    { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
-                ]
-            },
-            // './views/platform/bpmn/communication/communicationList
-            mainActions: [{
-                'name': this.$t('common.button.remove'),
-                'type': 'danger',
-                'callback': this.onRemove
-            }],
-            stateActive: false,
-            subject: '',
-            moreSubject: '',
-            subjectTitle: '',
-            typeId: '',
-            moreParams: {},
-            listData: [],
-            listCopy: [],
-            pagination: {},
-            sorts: {},
+  components: {
+    IbpsMoreSearch,
+    IbpsTypeTree,
+    IbpsAvatar,
+    IbpsToolbar,
+    IbpsListResultPage,
+    IbpsBpmnFormrenderDialog,
+    LookDocument
+  },
+  mixins: [random, bpmnStatus],
+  data() {
+    const { userId, userList = [], deptList, menus, userInfo, role } = this.$store.getters
+    const depArrs = []
+    var fileDownloadAuthority = false
+    for (var i of deptList) {
+      depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
+    }
+    const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
+    for (const i of roleKey) {
+      if (role.some(so => { return so.alias === i })) {
+        fileDownloadAuthority = true
+        break
+      }
+    }
+    return {
+      categoryKey: '',
+      documentsSon: false,
+      sonData: '',
+      userId: userId,
+      footText: false,
+      showPop: false,
+      noData: false,
+      showConfirmationBoxList: true,
+      countTotal: {},
+      examPopup: '',
+      ReachBottomShow: false,
+      moreSearchPopup: false,
+      searchForms: {
+        forms: [
+          // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
+          //   { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
+          { prop: 'examName', label: '考试名称', fieldType: 'text' },
+          { prop: 'bankName', label: '题库名称', fieldType: 'text' },
+          {
+            prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
+              { value: 'trainingExam', label: '培训考试' },
+              { value: 'POCTtraining', label: 'POCT培训' },
+              { value: 'selfAssessment', label: '自主考核' },
+              { value: 'routine', label: '常规' }
+            ]
+          },
+          { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
+          { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
+        ]
+      },
+      // './views/platform/bpmn/communication/communicationList
+      mainActions: [{
+        'name': this.$t('common.button.remove'),
+        'type': 'danger',
+        'callback': this.onRemove
+      }],
+      stateActive: false,
+      subject: '',
+      moreSubject: '',
+      subjectTitle: '',
+      typeId: '',
+      moreParams: {},
+      listData: [],
+      listCopy: [],
+      pagination: {},
+      sorts: {},
 
-            loading: false,
-            finished: false,
-            refreshing: false,
-            resultType: 'init',
-            errorType: null,
-            resultMessage: null,
+      loading: false,
+      finished: false,
+      refreshing: false,
+      resultType: 'init',
+      errorType: null,
+      resultMessage: null,
 
-            checkMode: false,
-            checkedIds: [],
-            proInstId: '',
-            defId: '',
-            formrenderVisible: false,
-            formrenderTitle: '',
-            typeTreePopup: false,
-            keyword: '',
-            name: '全部',
-            current: 0,
-            startTime: [],
-            endTime: [],
-            fileTypesDatas: {
-                comAuthority: [],
-                buMenAuthority: [],
-                authority: []
-            }, // 存放所点击列表的分类信息
-            searchWhere: {},
-            sqlWhere: {},
-            addDataCont: {},
-            oldorgId: '',
-            listConfig: {
-                // 工具栏
-                toolbars: [
-                    { key: 'search' },
-                    {
-                        key: 'colect',
-                        label: '收藏或取消收藏',
-                        type: 'success'
-                    }
-                ],
-                // 查询条件
-                searchForm: {
-                    forms: []
-                },
-                // 表格字段配置
-                columns: []
-            },
-            pageKey: '',
-            depArrs,
-            fileDownloadAuthority
-        }
+      checkMode: false,
+      checkedIds: [],
+      proInstId: '',
+      defId: '',
+      formrenderVisible: false,
+      formrenderTitle: '',
+      typeTreePopup: false,
+      keyword: '',
+      name: '全部',
+      current: 0,
+      startTime: [],
+      endTime: [],
+      fileTypesDatas: {
+        comAuthority: [],
+        buMenAuthority: [],
+        authority: []
+      }, // 存放所点击列表的分类信息
+      searchWhere: {},
+      sqlWhere: {},
+      addDataCont: {},
+      oldorgId: '',
+      listConfig: {
+        // 工具栏
+        toolbars: [
+          { key: 'search' },
+          {
+            key: 'colect',
+            label: '收藏或取消收藏',
+            type: 'success'
+          }
+        ],
+        // 查询条件
+        searchForm: {
+          forms: []
+        },
+        // 表格字段配置
+        columns: []
+      },
+      pageKey: '',
+      depArrs,
+      fileDownloadAuthority
+    }
+  },
+  computed: {
+    ...mapState('ibps/user', [
+      'info'
+    ]),
+    rightText() {
+      return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+    }
+    // selectedIds() {
+    //     console.log('this.checkedIds', this.checkedIds)
+    //     console.log('this.checkedIds', this.checkedIds.join(','))
+    //     return this.checkedIds.join(',')
+    // }
+  },
+
+  beforeRouteLeave(to, from, next) {
+    if (this.showPop === true) {
+      // this.showConfirmationBoxList = true
+      this.$refs.childPop.parentSubmit()
+      this.showPop = false
+      next(false)
+    } else {
+      next()
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      setTimeout(() => {
+        this.clickTypeNode(this.$refs.typeTree.treeData[0])
+        setTimeout(() => {
+          this.onRefresh()
+        }, 500)
+      }, 200)
+    })
+  },
+  created() {
+    this.pageKey = this.$route.name
+    this.categoryKey = this.$route.name === 'documents' ? 'FLOW_TYPE' : 'FILE_TYPE'
+  },
+  methods: {
+    onClick(item, index) {
+      this.documentsSon = true
+      this.sonData = item
     },
-    computed: {
-        ...mapState('ibps/user', [
-            'info'
-        ]),
-        rightText() {
-            return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
-        }
-        // selectedIds() {
-        //     console.log('this.checkedIds', this.checkedIds)
-        //     console.log('this.checkedIds', this.checkedIds.join(','))
-        //     return this.checkedIds.join(',')
-        // }
+    son() {
+      this.documentsSon = false
+    },
+    onClose() {
+      this.ReachBottomShow = false
     },
 
-    beforeRouteLeave(to, from, next) {
-        if (this.showPop === true) {
-        // this.showConfirmationBoxList = true
-            this.$refs.childPop.parentSubmit()
-            this.showPop = false
-            next(false)
-        } else {
-            next()
-        }
+    updataSet(v) {
+      this.showPop = v
     },
-    mounted() {
-        this.$nextTick(() => {
-            setTimeout(() => {
-                this.clickTypeNode(this.$refs.typeTree.treeData[0])
-                setTimeout(() => {
-                    this.onRefresh()
-                }, 500)
-            }, 200)
-        })
+    generateTitle(name, title) { // generateTitle by vue-i18n
+      return i18n.generateTitle(name, title)
     },
-    created() {
-        this.pageKey = this.$route.name
-        this.categoryKey = this.$route.name === 'documents' ? 'FLOW_TYPE' : 'FILE_TYPE'
+    toCheckMode() {
+      if (this.$utils.isEmpty(this.listData)) {
+        return
+      }
+      if (this.checkMode) {
+        // this.show = true
+        this.checkedIds = []
+      }
+      this.checkMode = !this.checkMode
+    },
+    clickType() {
+      this.typeTreePopup = true
+    },
+    onSearch() {
+      this.stateActive = false
+      ActionUtils.initListData(this)
+      this.current = 0
+      // this.listData = []
+      this.loadData()
+    },
+    clickMoreSearch() {
+      this.moreSearchPopup = true
+      this.stateActive = false
     },
-    methods: {
-        onClick(item, index) {
-            this.documentsSon = true
-            this.sonData = item
-        },
-        son() {
-            this.documentsSon = false
-        },
-        onClose() {
-            this.ReachBottomShow = false
-        },
-
-        updataSet(v) {
-            this.showPop = v
-        },
-        generateTitle(name, title) { // generateTitle by vue-i18n
-            return i18n.generateTitle(name, title)
-        },
-        toCheckMode() {
-            if (this.$utils.isEmpty(this.listData)) {
-                return
-            }
-            if (this.checkMode) {
-                // this.show = true
-                this.checkedIds = []
-            }
-            this.checkMode = !this.checkMode
-        },
-        clickType() {
-            this.typeTreePopup = true
-        },
-        onSearch() {
-            this.stateActive = false
-            ActionUtils.initListData(this)
-            this.current = 0
-            // this.listData = []
-            this.loadData()
-        },
-        clickMoreSearch() {
-            this.moreSearchPopup = true
-            this.stateActive = false
-        },
 
-        clickTypeNode(nodeData) {
-            var nodeId = nodeData.id
-            // console.log('nodeData', nodeData)
-            this.typeId = nodeData.id
-            this.onMoreSearch({})
-            this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
-            const fileTypes = []
-            if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
-                return
-            }
-            // 判断是否存在下级菜单
-            const noHadNext = nodeData.children === undefined
-            if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
-                const chongfu = this.listConfig.toolbars.filter(el => {
-                    return el.key === 'add'
-                })
-                if (chongfu.length === 0 && this.depth !== 0) {
-                    this.listConfig.toolbars.splice(1, 0, { key: 'add' })
-                }
-            } else {
-                this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
-                    return el.key !== 'add'
-                })
-            }
-            this.fileTypesDatas = {
-                comAuthority: [],
-                buMenAuthority: [],
-                authority: [],
-                shiJiSql: [],
-                sheBeiSql: []
-            }
-            if (nodeData.children === undefined) {
-                const authorityName = JSON.parse(nodeData.authorityName)
-                fileTypes.push(nodeId)
-                if (authorityName.chaYue === '公用查阅') {
-                    this.fileTypesDatas.comAuthority.push(nodeId)
-                }
-                if (authorityName.chaYue === '部门查阅') {
-                    this.fileTypesDatas.buMenAuthority.push(nodeId)
-                }
-                if (authorityName.chaYue === '受限查阅') {
-                    this.fileTypesDatas.authority.push(nodeId)
-                }
-            } else {
-                const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
-                const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
-                for (var i of result) {
-                    fileTypes.push(i.id)
-                    const authorityName = JSON.parse(i.authorityName)
-                    if (authorityName.chaYue === '公用查阅') {
-                        this.fileTypesDatas.comAuthority.push(i.id)
-                    }
-                    if (authorityName.chaYue === '部门查阅') {
-                        this.fileTypesDatas.buMenAuthority.push(i.id)
-                    }
-                    if (authorityName.chaYue === '受限查阅') {
-                        this.fileTypesDatas.authority.push(i.id)
-                    }
-                }
-            }
-            this.oldorgId = nodeId
-            this.sqlWhere = {
-                fileType: fileTypes.join(',')
-            }
-            this.getDatas()
-            // const fileTypes = []
-        },
-        getDatas() {
-            const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
-            const { fileType, sorts } = this.sqlWhere
-            this.listData = []
-            let wheres1 = '' // 共用
-            let wheres2 = '' // 部门
-            let wheres3 = '' // 受限
-            let start = ''
-            const positionsDatas = this.$store.getters.userInfo.positions
-            const needSelType = []
-            if (this.$store.getters.userInfo.positions === 0) {
-                this.$message({
-                    message: '该账户并没有所属部门,请先归属部门再来操作。',
-                    type: 'error'
-                })
-                return
-            }
-            for (var i in this.searchWhere) {
-                // console.log('i', i)
-                if (i === 'b') {
-                    start = this.searchWhere[i]
-                }
-                if (i === 'i') {
-                    wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                }
-                if (i !== 'i' && i !== 'b') {
-                    const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
-                    wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
-                }
-            }
-            // 一样
-            if (fileType) {
-                if (this.pageKey === 'documents') {
-                    if (comAuthority.length !== 0) {
-                        wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
-                    }
-                    if (buMenAuthority.length !== 0) {
-                        let orSql = ''
-                        // eslint-disable-next-line no-redeclare
-                        for (const i in positionsDatas) {
-                            if (i === '0') {
-                                orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
-                            } else {
-                                orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
-                            }
-                        }
-                        wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
-                    }
-                    if (authority.length !== 0) {
-                        wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
-                    }
-                } else {
-                    wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
-                }
-            }
-            // 没走
-            if (sorts) {
-                if (JSON.stringify(sorts) !== '{}') {
-                    wheres1 = wheres1 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-                    wheres2 = wheres2 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-                }
+    clickTypeNode(nodeData) {
+      var nodeId = nodeData.id
+      // console.log('nodeData', nodeData)
+      this.typeId = nodeData.id
+      this.onMoreSearch({})
+      this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
+      const fileTypes = []
+      if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
+        return
+      }
+      // 判断是否存在下级菜单
+      const noHadNext = nodeData.children === undefined
+      if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
+        const chongfu = this.listConfig.toolbars.filter(el => {
+          return el.key === 'add'
+        })
+        if (chongfu.length === 0 && this.depth !== 0) {
+          this.listConfig.toolbars.splice(1, 0, { key: 'add' })
+        }
+      } else {
+        this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
+          return el.key !== 'add'
+        })
+      }
+      this.fileTypesDatas = {
+        comAuthority: [],
+        buMenAuthority: [],
+        authority: [],
+        shiJiSql: [],
+        sheBeiSql: []
+      }
+      if (nodeData.children === undefined) {
+        const authorityName = JSON.parse(nodeData.authorityName)
+        fileTypes.push(nodeId)
+        if (authorityName.chaYue === '公用查阅') {
+          this.fileTypesDatas.comAuthority.push(nodeId)
+        }
+        if (authorityName.chaYue === '部门查阅') {
+          this.fileTypesDatas.buMenAuthority.push(nodeId)
+        }
+        if (authorityName.chaYue === '受限查阅') {
+          this.fileTypesDatas.authority.push(nodeId)
+        }
+      } else {
+        const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
+        const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
+        for (var i of result) {
+          fileTypes.push(i.id)
+          const authorityName = JSON.parse(i.authorityName)
+          if (authorityName.chaYue === '公用查阅') {
+            this.fileTypesDatas.comAuthority.push(i.id)
+          }
+          if (authorityName.chaYue === '部门查阅') {
+            this.fileTypesDatas.buMenAuthority.push(i.id)
+          }
+          if (authorityName.chaYue === '受限查阅') {
+            this.fileTypesDatas.authority.push(i.id)
+          }
+        }
+      }
+      this.oldorgId = nodeId
+      this.sqlWhere = {
+        fileType: fileTypes.join(',')
+      }
+      this.getDatas()
+      // const fileTypes = []
+    },
+    getDatas() {
+      const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
+      const { fileType, sorts } = this.sqlWhere
+      this.listData = []
+      let wheres1 = '' // 共用
+      let wheres2 = '' // 部门
+      let wheres3 = '' // 受限
+      let start = ''
+      const positionsDatas = this.$store.getters.userInfo.positions
+      const needSelType = []
+      if (this.$store.getters.userInfo.positions === 0) {
+        this.$message({
+          message: '该账户并没有所属部门,请先归属部门再来操作。',
+          type: 'error'
+        })
+        return
+      }
+      for (var i in this.searchWhere) {
+        // console.log('i', i)
+        if (i === 'b') {
+          start = this.searchWhere[i]
+        }
+        if (i === 'i') {
+          wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+          wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+          wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+        }
+        if (i !== 'i' && i !== 'b') {
+          const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
+          wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
+          wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
+          wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
+        }
+      }
+      // 一样
+      if (fileType) {
+        if (this.pageKey === 'documents') {
+          if (comAuthority.length !== 0) {
+            wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
+          }
+          if (buMenAuthority.length !== 0) {
+            let orSql = ''
+            // eslint-disable-next-line no-redeclare
+            for (const i in positionsDatas) {
+              if (i === '0') {
+                orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
+              } else {
+                orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
+              }
             }
-            const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
+            wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
+          }
+          if (authority.length !== 0) {
+            wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
+          }
+        } else {
+          wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
+        }
+      }
+      // 没走
+      if (sorts) {
+        if (JSON.stringify(sorts) !== '{}') {
+          wheres1 = wheres1 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
+          wheres2 = wheres2 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
+        }
+      }
+      const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
             wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_,	wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
 			wj.bian_zhi_ren_ AS bian_zhi_ren_,
 			wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
@@ -449,18 +449,18 @@ export default {
 			wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
 			wj.poct_shi_yong_ AS shi_yong_bu_men_,
 			"" AS cha_yue_jie_zhi_s  from`
-            const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
+      const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
             left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_
             left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_`
-            // 内外部文件查阅时候查所有文件
-            const allSql = ``
-            // 共用文件
-            const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' and (${this.depArrs.join(' or ')}) ${wheres1} `
-            // 部门权限文件
-            const buMenSql = `${selectSql}  t_wjxxb wj ${leftSql}
+      // 内外部文件查阅时候查所有文件
+      const allSql = ``
+      // 共用文件
+      const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' and (${this.depArrs.join(' or ')}) ${wheres1} `
+      // 部门权限文件
+      const buMenSql = `${selectSql}  t_wjxxb wj ${leftSql}
             where wj.shi_fou_guo_shen_ in ('有效','使用') ${wheres2} `
-            // 受限文件:结合查阅授权模块的截止时间
-            const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
+      // 受限文件:结合查阅授权模块的截止时间
+      const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
             wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_,	wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
 			wj.bian_zhi_ren_ AS bian_zhi_ren_,
 			wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
@@ -474,208 +474,208 @@ export default {
         ${leftSql}
         WHERE wj.shi_fou_guo_shen_ ='有效' and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
         and wj.quan_xian_xin_xi_ like '%${this.userId}%'  ${wheres3} `
-            const sqlArr = [comSql, buMenSql, authoritySql]
-            let oldRecordSql = ''
-            const buMenWhere = []
-            if (this.pageKey !== 'documents') {
-                if (this.$store.getters.deptList.length !== 0) {
-                    // eslint-disable-next-line no-redeclare
-                    for (var i of this.$store.getters.deptList) {
-                        buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
-                    }
-                    oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj 
+      const sqlArr = [comSql, buMenSql, authoritySql]
+      let oldRecordSql = ''
+      const buMenWhere = []
+      if (this.pageKey !== 'documents') {
+        if (this.$store.getters.deptList.length !== 0) {
+          // eslint-disable-next-line no-redeclare
+          for (var i of this.$store.getters.deptList) {
+            buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
+          }
+          oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj 
                     left join ibps_party_employee ee on wj.bian_zhi_ren_ = ee.id_ 
                     LEFT JOIN ibps_party_entity en ON en.id_= bian_zhi_bu_men_ 
                     where (${buMenWhere.join(' or ')}) ${wheres1}  order by bian_zhi_shi_jian desc`
-                } else {
-                    console.log('没有部门组织')
-                    return
-                }
-            }
-            // eslint-disable-next-line no-redeclare
-            for (var i in Object.keys(this.fileTypesDatas)) {
-                var key = Object.keys(this.fileTypesDatas)[i] // key
-                var value = this.fileTypesDatas[key] // value
-                if (value.length !== 0) {
-                    needSelType.push(`(${sqlArr[i]})`)
-                }
-            }
-            const fileSearchSql = needSelType.join('union all')
-            const sql = this.pageKey === 'documents' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC ` : oldRecordSql
-            curdPost('sql', sql).then(res => {
-                this.listCopy = []
-                this.current = 0
-                this.listCopy = res.variables.data
-                this.onRefresh()
-                this.loadData()
-                // const tableDatas = res.variables.data
-            // this.selectListData = JSON.parse(JSON.stringify(tableDatas))
-            // let filterDatas = []
-            // this.bianlistData.pageResult.totalCount = tableDatas.length
-            // this.bianlistData.pageResult.totalPages = Math.ceil(tableDatas.length / this.pagination.limit)
-            // this.bianlistData.pageResult.limit = this.pagination.limit
-            // this.bianlistData.pageResult.page = this.pagination.page
-            // if (this.pagination.limit > tableDatas.length) {
-            //     filterDatas = JSON.parse(JSON.stringify(tableDatas))
-            // } else {
-            //     for (let index = 0; index < 20; index++) {
-            //         filterDatas.push(tableDatas[index])
-            //     }
-            // }
-            // this.bianlistData.dataResult = filterDatas
-            // ActionUtils.handleListData(this, this.bianlistData)
-            }).catch(res => {
-                this.loading = false
-                this.listData = []
-            })
-        },
-        // 高级查询
-        onMoreSearch(params) {
-            if (this.$utils.isNotEmpty(this.typeId)) {
-                params['Q^type_id_^SL'] = this.typeId
-            }
-            this.moreParams = params
-            this.onSearch()
-            if (this.$utils.isNotEmpty(params)) {
-                this.stateActive = true
-            }
-        },
-        resetForm() {
-            this.typeId = ''
-        },
-        // 下拉刷新
-        onRefresh() {
-            this.footText = false
-            this.noData = false
-            this.refreshing = true
-            this.finished = false
-            this.loading = true
-            this.onSearch()
-        },
-        onRefreshPage() {
-            this.checkedIds = []
-            this.checkMode = false
-            this.onRefresh()
-        },
-        searchGao() {
+        } else {
+          console.log('没有部门组织')
+          return
+        }
+      }
+      // eslint-disable-next-line no-redeclare
+      for (var i in Object.keys(this.fileTypesDatas)) {
+        var key = Object.keys(this.fileTypesDatas)[i] // key
+        var value = this.fileTypesDatas[key] // value
+        if (value.length !== 0) {
+          needSelType.push(`(${sqlArr[i]})`)
+        }
+      }
+      const fileSearchSql = needSelType.join('union all')
+      const sql = this.pageKey === 'documents' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC ` : oldRecordSql
+    //   curdPost('sql', sql).then(res => {
+    //     this.listCopy = []
+    //     this.current = 0
+    //     this.listCopy = res.variables.data
+    //     this.onRefresh()
+    //     this.loadData()
+      // const tableDatas = res.variables.data
+      // this.selectListData = JSON.parse(JSON.stringify(tableDatas))
+      // let filterDatas = []
+      // this.bianlistData.pageResult.totalCount = tableDatas.length
+      // this.bianlistData.pageResult.totalPages = Math.ceil(tableDatas.length / this.pagination.limit)
+      // this.bianlistData.pageResult.limit = this.pagination.limit
+      // this.bianlistData.pageResult.page = this.pagination.page
+      // if (this.pagination.limit > tableDatas.length) {
+      //     filterDatas = JSON.parse(JSON.stringify(tableDatas))
+      // } else {
+      //     for (let index = 0; index < 20; index++) {
+      //         filterDatas.push(tableDatas[index])
+      //     }
+      // }
+      // this.bianlistData.dataResult = filterDatas
+      // ActionUtils.handleListData(this, this.bianlistData)
+    //   }).catch(res => {
+    //     this.loading = false
+    //     this.listData = []
+    //   })
+    },
+    // 高级查询
+    onMoreSearch(params) {
+      if (this.$utils.isNotEmpty(this.typeId)) {
+        params['Q^type_id_^SL'] = this.typeId
+      }
+      this.moreParams = params
+      this.onSearch()
+      if (this.$utils.isNotEmpty(params)) {
+        this.stateActive = true
+      }
+    },
+    resetForm() {
+      this.typeId = ''
+    },
+    // 下拉刷新
+    onRefresh() {
+      this.footText = false
+      this.noData = false
+      this.refreshing = true
+      this.finished = false
+      this.loading = true
+      this.onSearch()
+    },
+    onRefreshPage() {
+      this.checkedIds = []
+      this.checkMode = false
+      this.onRefresh()
+    },
+    searchGao() {
 
-        },
-        /**
+    },
+    /**
        * 加载数据
        */
-        loadData() {
-            this.loading = true
-            this.refreshing = false
-            if (this.current >= this.listCopy.length) {
-                this.listData = []
-                this.finished = true
-                this.noData = true
-                this.footText = false
-                return
-            }
-            // 查询搜索
-            const subject = this.subject
-            if (subject) {
-                const filteredList = this.listCopy.filter(item => {
-                    return item.wen_jian_ming_che.includes(subject)
-                })
-                if (filteredList.length <= 0) {
-                    this.footText = false
-                    this.loading = false
-                    this.noData = true
-                    return
-                }
-                // 计算本次加载的数据量
-                const endIndex = Math.min(this.current + 10, filteredList.length)
-                // 加载数据
-                const newData = filteredList.slice(this.current, endIndex)
-                this.listData.push(...newData)
-                this.current = endIndex
-                if (endIndex >= filteredList.length) {
-                    this.finished = true
-                    this.footText = true
-                    this.noData = false
-                }
-                this.loading = false
-                return
-            }
-            // 计算本次加载的数据量
-            const endIndex = Math.min(this.current + 10, this.listCopy.length)
-            // 加载数据
-            const newData = this.listCopy.slice(this.current, endIndex)
-            this.listData.push(...newData)
-            // 更新状态
-            this.current = endIndex
+    loadData() {
+      this.loading = true
+      this.refreshing = false
+      if (this.current >= this.listCopy.length) {
+        this.listData = []
+        this.finished = true
+        this.noData = true
+        this.footText = false
+        return
+      }
+      // 查询搜索
+      const subject = this.subject
+      if (subject) {
+        const filteredList = this.listCopy.filter(item => {
+          return item.wen_jian_ming_che.includes(subject)
+        })
+        if (filteredList.length <= 0) {
+          this.footText = false
+          this.loading = false
+          this.noData = true
+          return
+        }
+        // 计算本次加载的数据量
+        const endIndex = Math.min(this.current + 10, filteredList.length)
+        // 加载数据
+        const newData = filteredList.slice(this.current, endIndex)
+        this.listData.push(...newData)
+        this.current = endIndex
+        if (endIndex >= filteredList.length) {
+          this.finished = true
+          this.footText = true
+          this.noData = false
+        }
+        this.loading = false
+        return
+      }
+      // 计算本次加载的数据量
+      const endIndex = Math.min(this.current + 10, this.listCopy.length)
+      // 加载数据
+      const newData = this.listCopy.slice(this.current, endIndex)
+      this.listData.push(...newData)
+      // 更新状态
+      this.current = endIndex
 
-            // 检查是否加载完毕
-            if (endIndex >= this.listCopy.length) {
-                this.finished = true
-                this.footText = true
-                this.noData = false
-            }
+      // 检查是否加载完毕
+      if (endIndex >= this.listCopy.length) {
+        this.finished = true
+        this.footText = true
+        this.noData = false
+      }
 
-            // 结束加载动画
-            this.loading = false
+      // 结束加载动画
+      this.loading = false
 
-            // this.listData = this.listCopy
-            // this.loading = true
-            // let page = 0
-            // if (this.current === 0) {
-            //     page = 0
-            // } else {
-            //     page = this.current * 10
-            // }
-            // if (this.listData || this.listData.length === 0) {
-            //     this.finished = true
-            //     this.noData = true
-            //     this.footText = false
-            // }
+      // this.listData = this.listCopy
+      // this.loading = true
+      // let page = 0
+      // if (this.current === 0) {
+      //     page = 0
+      // } else {
+      //     page = this.current * 10
+      // }
+      // if (this.listData || this.listData.length === 0) {
+      //     this.finished = true
+      //     this.noData = true
+      //     this.footText = false
+      // }
 
-            // this.$common.request('sql', sql1).then(res => {
-            //     if (this.current === 0 && res.variables.data.length === 0) {
-            //         this.finished = true
-            //         this.noData = true
-            //         this.footText = false
-            //     }
+      // this.$common.request('sql', sql1).then(res => {
+      //     if (this.current === 0 && res.variables.data.length === 0) {
+      //         this.finished = true
+      //         this.noData = true
+      //         this.footText = false
+      //     }
 
-            //     const data = res.variables.data
-            //     this.listData.push(...data)
-            //     this.refreshing = false
-            //     if (this.listData.length !== 0 && (this.listData.length) % 10 !== 0) {
-            //         this.footText = true
-            //         this.noData = false
-            //         this.finished = true
-            //         return
-            //     } else {
-            //         this.current++
-            //     }
-            //     this.loading = false
-            // }).catch(err => {
-            //     console.log(err)
-            // })
-        },
+      //     const data = res.variables.data
+      //     this.listData.push(...data)
+      //     this.refreshing = false
+      //     if (this.listData.length !== 0 && (this.listData.length) % 10 !== 0) {
+      //         this.footText = true
+      //         this.noData = false
+      //         this.finished = true
+      //         return
+      //     } else {
+      //         this.current++
+      //     }
+      //     this.loading = false
+      // }).catch(err => {
+      //     console.log(err)
+      // })
+    },
 
-        // 获取格式化参数
-        getSearcFormData() {
-            let params = {}
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^subject_^SL'] = this.subject
-            }
-            if (this.$utils.isNotEmpty(this.moreParams)) {
-                params = Object.assign(params, this.moreParams)
-            }
-            return ActionUtils.formatParams(
-                params,
-                this.pagination,
-                this.sorts)
-        },
+    // 获取格式化参数
+    getSearcFormData() {
+      let params = {}
+      if (this.$utils.isNotEmpty(this.subject)) {
+        params['Q^subject_^SL'] = this.subject
+      }
+      if (this.$utils.isNotEmpty(this.moreParams)) {
+        params = Object.assign(params, this.moreParams)
+      }
+      return ActionUtils.formatParams(
+        params,
+        this.pagination,
+        this.sorts)
+    },
 
-        transformTime(timeStamp) {
-            const hours = Math.floor(parseInt(timeStamp) / 3600000)
-            const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
-            return hours + '小时' + minutes + '分钟'
-        }
+    transformTime(timeStamp) {
+      const hours = Math.floor(parseInt(timeStamp) / 3600000)
+      const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
+      return hours + '小时' + minutes + '分钟'
     }
+  }
 }
 </script>
 <style scoped lang="scss">

+ 35 - 33
src/views/platform/bpmn/documents/lookDocument.vue

@@ -74,42 +74,44 @@
 </template>
 <script>
 export default {
-    props: {
-        sonData: {
-            type: Object
-            // default: {}
-        },
-        updateFile: {
-            type: Boolean,
-            default: false
-        }
+  props: {
+    sonData: {
+      type: Object
+      // default: {}
     },
-    data() {
-        const userList = this.$store.getters.userList
-        const deptList = this.$store.getters.deptList
-        return {
-            userList: userList,
-            deptList: deptList
-        }
+    updateFile: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    const userList = this.$store.getters.userList
+    const deptList = this.$store.getters.deptList
+    return {
+      userList: userList,
+      deptList: deptList
+    }
+  },
+  mounted() {
+    console.log(this.sonData, '1111111111')
+  },
+  methods: {
+    changUserName(data) {
+      const user = this.userList.find(item => item.userId === data.bian_zhi_ren_)
+      if (user) {
+        return user.userName
+      }
     },
-
-    methods: {
-        changUserName(data) {
-            const user = this.userList.find(item => item.userId === data.bian_zhi_ren_)
-            if (user) {
-                return user.userName
-            }
-        },
-        changeDep(data) {
-            const dep = this.deptList.find(item => item.positionId === data.bian_zhi_bu_men_)
-            if (dep) {
-                return dep.positionName
-            }
-        },
-        onClose() {
-            this.$emit('son', false)
-        }
+    changeDep(data) {
+      const dep = this.deptList.find(item => item.positionId === data.bian_zhi_bu_men_)
+      if (dep) {
+        return dep.positionName
+      }
+    },
+    onClose() {
+      this.$emit('son', false)
     }
+  }
 }
 </script>
 <style scoped lang="less">

+ 500 - 460
src/views/platform/bpmn/documents/test.vue

@@ -113,214 +113,217 @@ import IbpsToolbar from '@/components/ibps-toolbar'
 import IbpsListResultPage from '@/components/ibps-list-result-page'
 import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 import LookDocument from './lookDocument'
+import { queryFileInfo } from '@/api/platform/feature/sqlInject'
+import { keyBy, mapValues } from 'lodash'
+
 const _ = require('lodash')
 
 export default {
-    components: {
-        IbpsMoreSearch,
-        IbpsTypeTree,
-        IbpsAvatar,
-        IbpsToolbar,
-        IbpsListResultPage,
-        IbpsBpmnFormrenderDialog,
-        LookDocument
-    },
-    mixins: [random, bpmnStatus],
-    data() {
-        const { userId, userList = [], deptList, menus, userInfo, role, isSuper } = this.$store.getters
-        const depArrs = []
-        var fileDownloadAuthority = false
-        for (var i of deptList) {
-            depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
-        }
-        const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
-        for (const i of roleKey) {
-            if (role.some(so => { return so.alias === i })) {
-                fileDownloadAuthority = true
-                break
-            }
-        }
-        return {
-            isSuper: isSuper,
-            role: role,
-            updateFile: false,
-            documentsSon: false,
-            sonData: '',
-            stateActive: false,
-            moreSearchPopup: false,
-            typeTreePopup: false,
-            searchForms: {
-                forms: [
-                    // { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
-                    { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
-                    { prop: 'Q^subject_^SL', label: '事务说明', fieldType: 'text' },
-                    { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
-                ]
-            },
+  components: {
+    IbpsMoreSearch,
+    IbpsTypeTree,
+    IbpsAvatar,
+    IbpsToolbar,
+    IbpsListResultPage,
+    IbpsBpmnFormrenderDialog,
+    LookDocument
+  },
+  mixins: [random, bpmnStatus],
+  data() {
+    const { userId, userList = [], deptList, menus, userInfo, role, isSuper } = this.$store.getters
+    const depArrs = []
+    var fileDownloadAuthority = false
+    for (var i of deptList) {
+      depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
+    }
+    const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
+    for (const i of roleKey) {
+      if (role.some(so => { return so.alias === i })) {
+        fileDownloadAuthority = true
+        break
+      }
+    }
+    return {
+      isSuper: isSuper,
+      role: role,
+      updateFile: false,
+      documentsSon: false,
+      sonData: '',
+      stateActive: false,
+      moreSearchPopup: false,
+      typeTreePopup: false,
+      searchForms: {
+        forms: [
+          // { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
+          { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
+          { prop: 'Q^subject_^SL', label: '事务说明', fieldType: 'text' },
+          { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
+        ]
+      },
 
-            subject: '',
-            typeId: '',
-            moreParams: {},
+      subject: '',
+      typeId: '',
+      moreParams: {},
 
-            listData: [],
-            pagination: {},
-            sorts: {},
+      listData: [],
+      pagination: {},
+      sorts: {},
 
-            loading: false,
-            finished: false,
-            refreshing: false,
-            resultType: 'init',
-            errorType: null,
-            resultMessage: null,
+      loading: false,
+      finished: false,
+      refreshing: false,
+      resultType: 'init',
+      errorType: null,
+      resultMessage: null,
 
-            checkMode: false,
-            checkedIds: [],
-            mainActions: [{
-                'name': this.$t('common.button.remove'),
-                'type': 'danger',
-                'callback': this.onRemove
-            }],
+      checkMode: false,
+      checkedIds: [],
+      mainActions: [{
+        'name': this.$t('common.button.remove'),
+        'type': 'danger',
+        'callback': this.onRemove
+      }],
 
-            proInstId: '',
-            defId: '',
-            formrenderVisible: false,
-            formrenderTitle: '',
-            fileTypesDatas: {
-                comAuthority: [],
-                buMenAuthority: [],
-                authority: []
-            }, // 存放所点击列表的分类信息
-            searchWhere: {},
-            sqlWhere: {},
-            addDataCont: {},
-            oldorgId: '',
-            listConfig: {
-                // 工具栏
-                toolbars: [
-                    { key: 'search' },
-                    {
-                        key: 'colect',
-                        label: '收藏或取消收藏',
-                        type: 'success'
-                    }
-                ],
-                // 查询条件
-                searchForm: {
-                    forms: []
-                },
-                // 表格字段配置
-                columns: []
-            },
-            pageKey: '',
-            depArrs,
-            fileDownloadAuthority,
-            current: 0,
-            footText: false,
-            noData: false,
-            watchF: false
-        }
-    },
-    computed: {
-        rightText() {
-            return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+      proInstId: '',
+      defId: '',
+      formrenderVisible: false,
+      formrenderTitle: '',
+      fileTypesDatas: {
+        comAuthority: [],
+        buMenAuthority: [],
+        authority: []
+      }, // 存放所点击列表的分类信息
+      searchWhere: {},
+      sqlWhere: {},
+      addDataCont: {},
+      oldorgId: '',
+      listConfig: {
+        // 工具栏
+        toolbars: [
+          { key: 'search' },
+          {
+            key: 'colect',
+            label: '收藏或取消收藏',
+            type: 'success'
+          }
+        ],
+        // 查询条件
+        searchForm: {
+          forms: []
         },
-        selectedIds() {
-            return this.checkedIds.join(',')
-        }
+        // 表格字段配置
+        columns: []
+      },
+      pageKey: '',
+      depArrs,
+      fileDownloadAuthority,
+      current: 0,
+      footText: false,
+      noData: false,
+      watchF: false
+    }
+  },
+  computed: {
+    rightText() {
+      return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
     },
-    watch: {
-        listData: {
-            handler(newValue, oldValue) {
-                if (newValue.length === 10 && this.watchF === false) {
-                    this.watchF = true
-                    this.onRefresh()
-                }
-            }
+    selectedIds() {
+      return this.checkedIds.join(',')
+    }
+  },
+  watch: {
+    listData: {
+      handler(newValue, oldValue) {
+        if (newValue.length === 10 && this.watchF === false) {
+          this.watchF = true
+          this.onRefresh()
+        }
+      }
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      const timer = setInterval(() => {
+        const cout = this.$refs.typeTree
+        if (cout && cout.treeData[cout.treeData.length - 1]) {
+          this.clickTypeNode(cout.treeData[cout.treeData.length - 1])
+          clearInterval(timer)
         }
+      }, 200)
+    })
+  },
+  created() {
+    this.pageKey = this.$route.name
+  },
+  methods: {
+    generateTitle(name, title) { // generateTitle by vue-i18n
+      return i18n.generateTitle(name, title)
     },
-    mounted() {
-        this.$nextTick(() => {
-            const timer = setInterval(() => {
-                const cout = this.$refs.typeTree
-                if (cout && cout.treeData[cout.treeData.length - 1]) {
-                    this.clickTypeNode(cout.treeData[cout.treeData.length - 1])
-                    clearInterval(timer)
-                }
-            }, 200)
+    getData() {
+      const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
+      const { fileType, sorts } = this.sqlWhere
+      let wheres1 = '' // 共用
+      let wheres2 = '' // 部门
+      let wheres3 = '' // 受限
+      const start = ''
+      const positionsDatas = this.$store.getters.userInfo.positions
+      const needSelType = []
+      if (this.$store.getters.userInfo.positions === 0) {
+        this.$message({
+          message: '该账户并没有所属部门,请先归属部门再来操作。',
+          type: 'error'
         })
-    },
-    created() {
-        this.pageKey = this.$route.name
-    },
-    methods: {
-        generateTitle(name, title) { // generateTitle by vue-i18n
-            return i18n.generateTitle(name, title)
-        },
-        getData() {
-            const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
-            const { fileType, sorts } = this.sqlWhere
-            let wheres1 = '' // 共用
-            let wheres2 = '' // 部门
-            let wheres3 = '' // 受限
-            let start = ''
-            const positionsDatas = this.$store.getters.userInfo.positions
-            const needSelType = []
-            if (this.$store.getters.userInfo.positions === 0) {
-                this.$message({
-                    message: '该账户并没有所属部门,请先归属部门再来操作。',
-                    type: 'error'
-                })
-                return
-            }
-            for (var i in this.searchWhere) {
-                if (i === 'b') {
-                    start = this.searchWhere[i]
-                }
-                if (i === 'i') {
-                    wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                    wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
-                }
-                if (i !== 'i' && i !== 'b') {
-                    const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
-                    wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
-                    wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
-                }
-            }
-            // 一样
-            if (fileType) {
-                if (this.pageKey === 'test') {
-                    if (comAuthority.length !== 0) {
-                        wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
-                    }
-                    if (buMenAuthority.length !== 0) {
-                        let orSql = ''
-                        // eslint-disable-next-line no-redeclare
-                        for (const i in positionsDatas) {
-                            if (i === '0') {
-                                orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
-                            } else {
-                                orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
-                            }
-                        }
-                        wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
-                    }
-                    if (authority.length !== 0) {
-                        wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
-                    }
-                } else {
-                    wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
-                }
-            }
-            // 没走
-            if (sorts) {
-                if (JSON.stringify(sorts) !== '{}') {
-                    wheres1 = wheres1 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-                    wheres2 = wheres2 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
-                }
+        return
+      }
+      //   for (var i in this.searchWhere) {
+      //     if (i === 'b') {
+      //       start = this.searchWhere[i]
+      //     }
+      //     if (i === 'i') {
+      //       wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+      //       wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+      //       wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
+      //     }
+      //     if (i !== 'i' && i !== 'b') {
+      //       const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
+      //       wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
+      //       wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
+      //       wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
+      //     }
+      //   }
+      // 一样
+      if (fileType) {
+        if (this.pageKey === 'test') {
+          if (comAuthority.length !== 0) {
+            wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
+          }
+          if (buMenAuthority.length !== 0) {
+            let orSql = ''
+            // eslint-disable-next-line no-redeclare
+            for (const i in positionsDatas) {
+              if (i === '0') {
+                orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
+              } else {
+                orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
+              }
             }
-            const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
+            wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
+          }
+          if (authority.length !== 0) {
+            wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
+          }
+        } else {
+          wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
+        }
+      }
+      // 没走
+      if (sorts) {
+        if (JSON.stringify(sorts) !== '{}') {
+          wheres1 = wheres1 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
+          wheres2 = wheres2 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
+        }
+      }
+      const selectSql = `select  wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
             wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_,	wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
 			wj.bian_zhi_ren_ AS bian_zhi_ren_,
 			wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
@@ -329,18 +332,18 @@ export default {
 			wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
 			wj.poct_shi_yong_ AS shi_yong_bu_men_,
 			"" AS cha_yue_jie_zhi_s  from`
-            const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
+      const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
             left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_
             left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_`
-            // 内外部文件查阅时候查所有文件
-            const allSql = ``
-            // 共用文件
-            const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') and (${this.depArrs.join(' or ')}) ${wheres1} `
-            // 部门权限文件
-            const buMenSql = `${selectSql}  t_wjxxb wj ${leftSql}
+      // 内外部文件查阅时候查所有文件
+      const allSql = ``
+      // 共用文件
+      const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') and (${this.depArrs.join(' or ')}) ${wheres1} `
+      // 部门权限文件
+      const buMenSql = `${selectSql}  t_wjxxb wj ${leftSql}
             where wj.shi_fou_guo_shen_ in ('有效','使用') AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') ${wheres2} `
-            // 受限文件:结合查阅授权模块的截止时间
-            const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
+      // 受限文件:结合查阅授权模块的截止时间
+      const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
             wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_,	wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
 			wj.bian_zhi_ren_ AS bian_zhi_ren_,
 			wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
@@ -354,289 +357,326 @@ export default {
         ${leftSql}
         WHERE wj.shi_fou_guo_shen_ ='有效' AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
         and wj.quan_xian_xin_xi_ like '%${this.userId}%'  ${wheres3} `
-            const sqlArr = [comSql, buMenSql, authoritySql]
+      const sqlArr = [comSql, buMenSql, authoritySql]
 
-            let oldRecordSql = ''
-            const buMenWhere = []
-            if (this.pageKey !== 'test') {
-                if (this.$store.getters.deptList.length !== 0) {
-                    // eslint-disable-next-line no-redeclare
-                    for (var i of this.$store.getters.deptList) {
-                        buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
-                    }
-                    oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj 
+      let oldRecordSql = ''
+      const buMenWhere = []
+      if (this.pageKey !== 'test') {
+        if (this.$store.getters.deptList.length !== 0) {
+          // eslint-disable-next-line no-redeclare
+          for (var i of this.$store.getters.deptList) {
+            buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
+          }
+          oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj 
                     left join ibps_party_employee ee on wj.bian_zhi_ren_ = ee.id_ 
                     LEFT JOIN ibps_party_entity en ON en.id_= bian_zhi_bu_men_ 
                     where (${buMenWhere.join(' or ')}) ${wheres1}  order by bian_zhi_shi_jian desc`
-                } else {
-                    console.log('没有部门组织')
-                    return
-                }
-            }
-            // eslint-disable-next-line no-redeclare
+        } else {
+          console.log('没有部门组织')
+          return
+        }
+      }
+      // eslint-disable-next-line no-redeclare
 
-            for (var i in Object.keys(this.fileTypesDatas)) {
-                var key = Object.keys(this.fileTypesDatas)[i] // key
-                var value = this.fileTypesDatas[key] // value
-                if (value.length !== 0) {
-                    needSelType.push(`(${sqlArr[i]})`)
-                }
-            }
-            const fileSearchSql = needSelType.join('union all')
-            const sql = this.pageKey === 'test' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC` : oldRecordSql
-            return fileSearchSql ? sql : ''
-        },
-        /**
+      for (var i in Object.keys(this.fileTypesDatas)) {
+        var key = Object.keys(this.fileTypesDatas)[i] // key
+        var value = this.fileTypesDatas[key] // value
+        if (value.length !== 0) {
+          needSelType.push(`(${sqlArr[i]})`)
+        }
+      }
+      const fileSearchSql = needSelType.join('union all')
+      const sql = this.pageKey === 'test' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC` : oldRecordSql
+      return fileSearchSql ? sql : ''
+    },
+    /**
        * 加载数据
        *
       */
-        loadData() {
-            this.loading = true
-            this.noData = false
-            this.footText = false
-            let page = 0
-            if (this.current === 0) {
-                page = 0
-            } else {
-                page = this.current * 10
-            }
-            const sqlPart = this.getData()
-            if (!sqlPart) return
-            const sql = sqlPart + ' ' + `LIMIT ${page},10`
-            curdPost('sql', sql).then(res => {
-                if (res.variables.data.length === 0) {
-                    if (this.current === 0) {
-                        this.noData = true
-                    } else {
-                        this.footText = true
-                    }
-                    this.finished = true
-                    this.loading = false
-                    this.refreshing = false
-                    return
-                }
+    loadData() {
+      this.loading = true
+      this.noData = false
+      this.footText = false
+      let page = 0
+      if (this.current === 0) {
+        page = 0
+      } else {
+        page = this.current * 10
+      }
+      const sqlPart = this.getData()
+      if (!sqlPart) return
+      const sql = sqlPart + ' ' + `LIMIT ${page},10`
+      queryFileInfo(this.getSearchParams()).then(res => {
+        this.loading = false
+        const { data = [], ...rest } = res.variables || {}
+        ActionUtils.handleListData(this, {
+          dataResult: data,
+          pageResult: rest
+        })
+      }).finally(() => {
+        this.loading = false
+      })
+      //   curdPost('sql', sql).then(res => {
+      //     if (res.variables.data.length === 0) {
+      //       if (this.current === 0) {
+      //         this.noData = true
+      //       } else {
+      //         this.footText = true
+      //       }
+      //       this.finished = true
+      //       this.loading = false
+      //       this.refreshing = false
+      //       return
+      //     }
 
-                this.listData.push(...res.variables.data)
+      //     this.listData.push(...res.variables.data)
 
-                // 判断是否还有更多数据
-                if ((this.listData.length) % 10 !== 0) {
-                    this.footText = true
-                    this.finished = true
-                } else {
-                    this.current++
-                }
+      //     // 判断是否还有更多数据
+      //     if ((this.listData.length) % 10 !== 0) {
+      //       this.footText = true
+      //       this.finished = true
+      //     } else {
+      //       this.current++
+      //     }
 
-                this.loading = false
-                this.refreshing = false
-            }).catch(e => {
-                console.log(e)
-            })
-        },
-        /**
+    //     this.loading = false
+    //     this.refreshing = false
+    //   }).catch(e => {
+    //     console.log(e)
+    //   })
+    },
+    getSearchParams() {
+      const { parameters, requestPage, sorts } = this.getSearchFormData() || {}
+      const { pageNo = 1, limit = 20 } = requestPage || {}
+      const params = mapValues(keyBy(parameters, 'key'), 'value')
+
+      if (sorts?.length) {
+        params.order = sorts.map(i => `${i.field} ${i.order}`).join(',')
+      }
+      if (this.oldorgId) {
+        params.folderId = this.oldorgId
+      }
+      if (this.subject) {
+        params.fileName = this.subject
+      }
+      return {
+        pageNo,
+        limit,
+        ...params
+      }
+    },
+    getSearchFormData() {
+      return ActionUtils.formatParams(
+        this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+        this.pagination,
+        this.sorts
+      )
+    },
+    /**
        * 获取格式化参数
        */
-        getSearcFormData() {
-            let params = {}
-            if (this.$utils.isNotEmpty(this.subject)) {
-                params['Q^subject_^SL'] = this.subject
-            }
-            if (this.$utils.isNotEmpty(this.moreParams)) {
-                params = Object.assign(params, this.moreParams)
-            }
-            return ActionUtils.formatParams(
-                params,
-                this.pagination,
-                this.sorts)
-        },
-        /**
+    // getSearcFormData() {
+    //   let params = {}
+    //   if (this.$utils.isNotEmpty(this.subject)) {
+    //     params['Q^subject_^SL'] = this.subject
+    //   }
+    //   if (this.$utils.isNotEmpty(this.moreParams)) {
+    //     params = Object.assign(params, this.moreParams)
+    //   }
+    //   return ActionUtils.formatParams(
+    //     params,
+    //     this.pagination,
+    //     this.sorts)
+    // },
+    /**
        * 下拉刷新
        */
-        onRefresh() {
-            this.footText = false
-            this.noData = false
-            this.refreshing = true
-            this.finished = false
-            this.loading = true
-            this.onSearch()
-        },
-        /**
+    onRefresh() {
+      this.footText = false
+      this.noData = false
+      this.refreshing = true
+      this.finished = false
+      this.loading = true
+      this.onSearch()
+    },
+    /**
        * 查询
        */
-        onSearch() {
-            this.stateActive = false
-            ActionUtils.initListData(this)
-            this.current = 0
-            this.listData = []
-            this.loadData()
-        },
-        /**
+    onSearch() {
+      this.stateActive = false
+      ActionUtils.initListData(this)
+      this.current = 0
+      this.listData = []
+      this.loadData()
+    },
+    /**
        * 高级查询
        */
-        onMoreSearch(params) {
-            if (this.$utils.isNotEmpty(this.typeId)) {
-                params['Q^type_id_^SL'] = this.typeId
-            }
-            this.moreParams = params
-            this.onSearch()
-            if (this.$utils.isNotEmpty(params)) {
-                this.stateActive = true
-            }
-        },
-        /**
+    onMoreSearch(params) {
+      if (this.$utils.isNotEmpty(this.typeId)) {
+        params['Q^type_id_^SL'] = this.typeId
+      }
+      this.moreParams = params
+      this.onSearch()
+      if (this.$utils.isNotEmpty(params)) {
+        this.stateActive = true
+      }
+    },
+    /**
        * 弹窗更多查询条件
        */
-        clickMoreSearch() {
-            this.moreSearchPopup = true
-            this.stateActive = false
-        },
-        /**
+    clickMoreSearch() {
+      this.moreSearchPopup = true
+      this.stateActive = false
+    },
+    /**
        * 重置表单
        */
-        resetForm() {
-            this.typeId = ''
-        },
-        getTaskDesc(v) {
-            if (!v.includes('#')) {
-                return ''
-            }
-            return v.split('#')[1] || ''
-        },
-        // 点击左边显示
-        clickType() {
-            this.typeTreePopup = true
-        },
-        clickTypeNode(nodeData) {
-            this.watchF = false
-            this.current = 0
-            // this.listData = []
-            this.typeId = nodeData.id
-            // this.onMoreSearch({})
-            var nodeId = nodeData.id
-            this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
-            const fileTypes = []
-            if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
-                return
-            }
-            // 判断是否存在下级菜单
-            const noHadNext = nodeData.children === undefined
-            if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
-                const chongfu = this.listConfig.toolbars.filter(el => {
-                    return el.key === 'add'
-                })
-                if (chongfu.length === 0 && this.depth !== 0) {
-                    this.listConfig.toolbars.splice(1, 0, { key: 'add' })
-                }
-            } else {
-                this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
-                    return el.key !== 'add'
-                })
-            }
-            this.fileTypesDatas = {
-                comAuthority: [],
-                buMenAuthority: [],
-                authority: [],
-                shiJiSql: [],
-                sheBeiSql: []
-            }
-            if (nodeData.children === undefined) {
-                const authorityName = JSON.parse(nodeData.authorityName)
-                fileTypes.push(nodeId)
-                if (authorityName.chaYue === '公用查阅') {
-                    this.fileTypesDatas.comAuthority.push(nodeId)
-                }
-                if (authorityName.chaYue === '部门查阅') {
-                    this.fileTypesDatas.buMenAuthority.push(nodeId)
-                }
-                if (authorityName.chaYue === '受限查阅') {
-                    this.fileTypesDatas.authority.push(nodeId)
-                }
-            } else {
-                const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
-                const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
-                for (var i of result) {
-                    fileTypes.push(i.id)
-                    const authorityName = JSON.parse(i.authorityName)
-                    if (authorityName.chaYue === '公用查阅') {
-                        this.fileTypesDatas.comAuthority.push(i.id)
-                    }
-                    if (authorityName.chaYue === '部门查阅') {
-                        this.fileTypesDatas.buMenAuthority.push(i.id)
-                    }
-                    if (authorityName.chaYue === '受限查阅') {
-                        this.fileTypesDatas.authority.push(i.id)
-                    }
-                }
-            }
-            this.oldorgId = nodeId
-            this.sqlWhere = {
-                fileType: fileTypes.join(',')
-            }
-            this.listData = []
-            this.loadData()
-        },
-        son() {
-            this.documentsSon = false
-            this.updateFile = false
-        },
-        onClick(item, index) {
-            const roleKey = ['zlfzr', 'wjgly', 'jsfzr', 'syszr', 'wjglzzc']
-            const curRole = this.role.map(i => i.alias)
-            const isPower = curRole.some(i => roleKey.includes(i))
-            if (this.isSuper || isPower) {
-                this.updateFile = true
-            }
-            this.documentsSon = true
-            this.sonData = item
+    resetForm() {
+      this.typeId = ''
+    },
+    getTaskDesc(v) {
+      if (!v.includes('#')) {
+        return ''
+      }
+      return v.split('#')[1] || ''
+    },
+    // 点击左边显示
+    clickType() {
+      this.typeTreePopup = true
+    },
+    clickTypeNode(nodeData) {
+      this.watchF = false
+      this.current = 0
+      // this.listData = []
+      this.typeId = nodeData.id
+      // this.onMoreSearch({})
+      var nodeId = nodeData.id
+      this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
+      const fileTypes = []
+      if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
+        return
+      }
+      // 判断是否存在下级菜单
+      const noHadNext = nodeData.children === undefined
+      if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
+        const chongfu = this.listConfig.toolbars.filter(el => {
+          return el.key === 'add'
+        })
+        if (chongfu.length === 0 && this.depth !== 0) {
+          this.listConfig.toolbars.splice(1, 0, { key: 'add' })
+        }
+      } else {
+        this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
+          return el.key !== 'add'
+        })
+      }
+      this.fileTypesDatas = {
+        comAuthority: [],
+        buMenAuthority: [],
+        authority: [],
+        shiJiSql: [],
+        sheBeiSql: []
+      }
+      if (nodeData.children === undefined) {
+        const authorityName = JSON.parse(nodeData.authorityName)
+        fileTypes.push(nodeId)
+        if (authorityName.chaYue === '公用查阅') {
+          this.fileTypesDatas.comAuthority.push(nodeId)
+        }
+        if (authorityName.chaYue === '部门查阅') {
+          this.fileTypesDatas.buMenAuthority.push(nodeId)
+        }
+        if (authorityName.chaYue === '受限查阅') {
+          this.fileTypesDatas.authority.push(nodeId)
+        }
+      } else {
+        const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
+        const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
+        for (var i of result) {
+          fileTypes.push(i.id)
+          const authorityName = JSON.parse(i.authorityName)
+          if (authorityName.chaYue === '公用查阅') {
+            this.fileTypesDatas.comAuthority.push(i.id)
+          }
+          if (authorityName.chaYue === '部门查阅') {
+            this.fileTypesDatas.buMenAuthority.push(i.id)
+          }
+          if (authorityName.chaYue === '受限查阅') {
+            this.fileTypesDatas.authority.push(i.id)
+          }
+        }
+      }
+      this.oldorgId = nodeId
+      this.sqlWhere = {
+        fileType: fileTypes.join(',')
+      }
+      this.listData = []
+      this.loadData()
+    },
+    son() {
+      this.documentsSon = false
+      this.updateFile = false
+    },
+    onClick(item, index) {
+      const roleKey = ['zlfzr', 'wjgly', 'jsfzr', 'syszr', 'wjglzzc']
+      const curRole = this.role.map(i => i.alias)
+      const isPower = curRole.some(i => roleKey.includes(i))
+      if (this.isSuper || isPower) {
+        this.updateFile = true
+      }
+      this.documentsSon = true
+      this.sonData = item
 
-            // if (this.checkMode) {
-            //     this.$refs.checkboxes[index].toggle()
-            // } else {
-            //     this.proInstId = item.id
-            //     this.defId = item.procDefId
+      // if (this.checkMode) {
+      //     this.$refs.checkboxes[index].toggle()
+      // } else {
+      //     this.proInstId = item.id
+      //     this.defId = item.procDefId
 
-            //     this.formrenderTitle = item.procDefName
-            //     this.formrenderVisible = true
-            // }
-        },
-        onRefreshPage() {
-            this.checkedIds = []
-            this.checkMode = false
-            this.onRefresh()
-        },
-        toCheckMode() {
-            if (this.$utils.isEmpty(this.listData)) {
-                return
-            }
-            if (this.checkMode) {
-                // this.show = true
-                this.checkedIds = []
-            }
-            this.checkMode = !this.checkMode
-        },
-        onRemove() {
-            if (this.checkedIds.length === 0) {
-                this.$notify({
-                    type: 'warning',
-                    message: this.$t('common.dialog.selectedRecords')
-                })
-                return
-            }
-            this.$dialog.confirm({
-                title: this.$t('common.dialog.warn'),
-                message: this.$t('common.operate.makeSure')
-            }).then(() => {
-                removeDraft({ ids: this.selectedIds }).then(response => {
-                    this.$notify({
-                        type: 'success',
-                        message: '删除草稿成功!'
-                    })
-                    this.onRefreshPage()
-                }).catch((e) => {
-                    console.error(e)
-                })
-            })
-        }
+      //     this.formrenderTitle = item.procDefName
+      //     this.formrenderVisible = true
+      // }
+    },
+    onRefreshPage() {
+      this.checkedIds = []
+      this.checkMode = false
+      this.onRefresh()
+    },
+    toCheckMode() {
+      if (this.$utils.isEmpty(this.listData)) {
+        return
+      }
+      if (this.checkMode) {
+        // this.show = true
+        this.checkedIds = []
+      }
+      this.checkMode = !this.checkMode
+    },
+    onRemove() {
+      if (this.checkedIds.length === 0) {
+        this.$notify({
+          type: 'warning',
+          message: this.$t('common.dialog.selectedRecords')
+        })
+        return
+      }
+      this.$dialog.confirm({
+        title: this.$t('common.dialog.warn'),
+        message: this.$t('common.operate.makeSure')
+      }).then(() => {
+        removeDraft({ ids: this.selectedIds }).then(response => {
+          this.$notify({
+            type: 'success',
+            message: '删除草稿成功!'
+          })
+          this.onRefreshPage()
+        }).catch((e) => {
+          console.error(e)
+        })
+      })
     }
+  }
 
 }
 </script>