liujiayin 2 лет назад
Родитель
Сommit
46616a7dba
2 измененных файлов с 22 добавлено и 17 удалено
  1. 19 14
      src/business/platform/cat/type/tree.vue
  2. 3 3
      src/views/infosManage/fileIE.vue

+ 19 - 14
src/business/platform/cat/type/tree.vue

@@ -1,6 +1,7 @@
 <template>
     <div class="jbd-tree">
         <ibps-tree
+            ref="treeIndex"
             :title="title"
             :width="width"
             :height="height"
@@ -9,11 +10,10 @@
             :options="treeOptions"
             :contextmenus="hasContextmenu ? treeContextmenus : []"
             :position="position"
-            :hasPermission="hasPermission"
+            :has-permission="hasPermission"
             @action-event="handleTreeAction"
             @node-click="handleNodeClick"
             @expand-collapse="handleExpandCollapse"
-            ref="treeIndex"
         />
         <!-- 分类编辑 -->
         <type-edit
@@ -96,7 +96,7 @@ export default {
             default: false
         }
     },
-    data() {
+    data () {
         return {
             typeFormVisible: false,
             sortFormVisible: false,
@@ -118,12 +118,17 @@ export default {
             typeData: {} // 记录分类信息
         }
     },
-    created() {
+    created () {
         this.loadTreeData()
     },
     methods: {
-        loadTreeData() {
-            findTreeData({ categoryKey: this.categoryKey }).then(response => {
+        loadTreeData () {
+            const { first = '', second = '' } = this.$store.getters.level || {}
+            const params = { categoryKey: this.categoryKey }
+            if (this.categoryKey === 'FILE_TYPE') {
+                params.diDian = second || first
+            }
+            findTreeData(params).then(response => {
                 this.treeData = response.data || []
                 if (this.hasPermission) {
                     this.treeData = this.treeData.filter(i => i.isShow !== '1')
@@ -131,7 +136,7 @@ export default {
                 this.$emit('treeData', response.data)
             })
         },
-        handleTreeAction(command, position, selection, data) {
+        handleTreeAction (command, position, selection, data) {
             switch (command) {
                 case 'refresh': // 查询
                     this.loadTreeData()
@@ -171,21 +176,21 @@ export default {
                     break
             }
         },
-        handleNodeClick(data) {
+        handleNodeClick (data) {
             this.$emit('node-click', data.parentId === '-1' ? '' : data.id, data, this.treeData)
         },
-        handleExpandCollapse(isExpand) {
+        handleExpandCollapse (isExpand) {
             this.$emit('expand-collapse', isExpand)
         },
-        handTreeEdit(editId) {
+        handTreeEdit (editId) {
             this.editId = editId || ''
             this.typeFormVisible = true
         },
-        handTreeMove(editId) {
+        handTreeMove (editId) {
             this.editId = editId || ''
             this.moveFormVisible = true
         },
-        handTreeSort(data) {
+        handTreeSort (data) {
             const children = data.children
             if (children && children.length > 0) {
                 if (children.length === 1) {
@@ -198,7 +203,7 @@ export default {
                 ActionUtils.warning('无子节点排序')
             }
         },
-        handleTreeRemove(ids) {
+        handleTreeRemove (ids) {
             ActionUtils.removeRecord(ids).then((ids) => {
                 remove({ typeId: ids }).then((response) => {
                     ActionUtils.removeSuccessMessage()
@@ -208,7 +213,7 @@ export default {
                 })
             }).catch(() => { })
         },
-        showTree() {
+        showTree () {
             this.$nextTick(() => {
                 this.$refs.treeIndex.handleExpandCollapse()
             })

+ 3 - 3
src/views/infosManage/fileIE.vue

@@ -242,7 +242,6 @@ export default {
             let start = ''
             //   console.log('this.$store.getters',this.$store.getters)
             const positionsDatas = this.$store.getters.userInfo.positions
-            console.log('getters1111')
             const needSelType = []
             if (this.$store.getters.userInfo.positions == 0) {
                 this.$message({
@@ -302,6 +301,8 @@ export default {
             //   let fileSearchSql = `select  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_,qx.bian_zhi_shi_jian
             //    FROM (SELECT *FROM (SELECT * FROM t_wjcysqb  ORDER BY create_time_ DESC LIMIT 99999999) a GROUP BY a.yong_hu_id_,a.wen_jian_id_) qx LEFT JOIN t_wjxxb wj ON qx.wen_jian_id_=wj.wen_jian_fu_jian_ WHERE qx.yong_hu_id_='${this.userId}' AND qx.shou_quan_='1' ${wheres1} GROUP BY qx.yong_hu_id_,qx.wen_jian_id_`
             const selectSql = 'select 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_,"" AS cha_yue_jie_zhi_s  from'
+            // 内外部文件查阅时候查所有文件
+            const allSql = ``
             // 共用文件
             const comSql = `${selectSql} t_wjxxb wj where wj.shi_fou_guo_shen_ ='有效' and (${this.depArrs.join(' or ')}) ${wheres1}`
             // 部门权限文件
@@ -364,12 +365,11 @@ export default {
             this.getDatas()
         },
         handleNodeClick (nodeId, nodeData, treeDatas) {
-            //   console.log('nodeData', nodeData)
             this.tableTitle = nodeData.name
             this.show = 'detail'
             this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
             const fileTypes = []
-            if (this.oldorgId == nodeId) {
+            if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
                 return
             }
             // 判断是否存在下级菜单