From bd7352fe785c10cd0ae103b4fc41262f86a422ea Mon Sep 17 00:00:00 2001 From: qinoy Date: Wed, 24 Aug 2022 14:24:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=8A=E5=88=A9=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E9=BB=98=E8=AE=A4=E5=8F=96=E6=B6=88=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/repository/Repository.vue | 33 +++++-- .../src/views/repository/RepositoryList.vue | 3 +- .../src/views/repository/RepositoryMain.vue | 89 ++++++++++++------- 3 files changed, 82 insertions(+), 43 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/views/repository/Repository.vue b/com.actionsoft.apps.coe.pal/src/views/repository/Repository.vue index 838ab05..ba557df 100644 --- a/com.actionsoft.apps.coe.pal/src/views/repository/Repository.vue +++ b/com.actionsoft.apps.coe.pal/src/views/repository/Repository.vue @@ -36,9 +36,10 @@ }, created() { this.getRouteParam(this.$route.query); + let that = this; setTimeout(() => { - this.initConditionData(); - },300) + that.initConditionData(); + },300); }, methods: { // 获取历史 @@ -57,13 +58,15 @@ if (ro.result === 'ok') { that.conditionData = ro.data // 历史查询条件保存 - let tempUserArr = [...that.conditionData.historyCondition.createUsers]; - that.$store.commit('setCreateUsers',tempUserArr); - let tempOrgIdArr = [...that.conditionData.historyCondition.orgIds]; - that.$store.commit('setOrgIds',tempOrgIdArr); - let tempMethodIdArr = [...that.conditionData.historyCondition.methodIds]; - that.$store.commit('setMethodIds',tempMethodIdArr); - that.conditionReFresh = true + if (that.conditionData.historyCondition) { + let tempUserArr = [...that.conditionData.historyCondition.createUsers]; + that.$store.commit('setCreateUsers',tempUserArr); + let tempOrgIdArr = [...that.conditionData.historyCondition.orgIds]; + that.$store.commit('setOrgIds',tempOrgIdArr); + let tempMethodIdArr = [...that.conditionData.historyCondition.methodIds]; + that.$store.commit('setMethodIds',tempMethodIdArr); + } + that.conditionReFresh = true; }else { that.$message({message: ro.msg, type: 'warning'}); } @@ -110,23 +113,35 @@ } }, watch : { + '$route': function (newd,old) { + this.conditionReFresh = false; + this.$nextTick(()=>{ + this.initConditionData(); + }); + }, listenTopMainHeight: function (newd, old) { this.mainHeight = (parseInt(newd)) + 'px'; }, listenWsId: function(newd, old) { this.reFresh = false; this.mainContent = ''; + this.conditionReFresh = false; this.$nextTick(()=>{ this.reFresh = true; this.mainContent = 'RepositoryMainList'; + + this.initConditionData(); }); }, listenTeamId: function(newd, old) { this.reFresh = false; this.mainContent = ''; + this.conditionReFresh = false; this.$nextTick(()=>{ this.reFresh = true; this.mainContent = 'RepositoryMainList'; + + this.initConditionData(); }); } }, diff --git a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryList.vue b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryList.vue index dbb9be9..5ca1966 100644 --- a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryList.vue +++ b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryList.vue @@ -478,7 +478,8 @@ havingRemovePerm:false, havingVersionManagePerm: false, havingWritePerm: false - } + }, + imgPath: '' } }, created() { diff --git a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryMain.vue b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryMain.vue index 19a2a89..73f622c 100644 --- a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryMain.vue +++ b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryMain.vue @@ -324,7 +324,7 @@ isLoading:false, multiple: true, // 创建人 - currentUserCheck: true, + currentUserCheck: false, currentUser: '', searchUserName: '', createUserOptions: [], @@ -346,7 +346,7 @@ addressType: 'department', searchOrgName: '', checkOrgIds: [], - currentUserDeptCheck: true, + currentUserDeptCheck: false, dis: false, headerHeight1: '88px', @@ -459,9 +459,11 @@ this.$store.commit('setCreateUsers',this.checkCreateUserIds); this.checkMethodIds = []; this.isIndeterminate = false; + this.userIndeterminate = false; this.checkAll = false; this.$store.commit('setMethodIds',this.checkMethodIds); this.checkOrgIds = []; + this.currentUserDeptCheck = false; this.$refs.orgTree.setCheckedKeys(this.checkOrgIds); this.$store.commit('setOrgIds',this.checkOrgIds); // 刷新左侧文件树以及右侧最近编辑与收藏 @@ -483,6 +485,11 @@ temp = [...this.checkOrgIds]; if (val) { temp.push(this.currentUser.deptId); + }else { + let index = temp.indexOf(this.currentUser.deptId); + if (index !== -1) { + temp.splice(index,1); + } } this.$refs.orgTree.setCheckedKeys(temp) this.$store.commit('setOrgIds',temp); @@ -503,6 +510,10 @@ if (this.checkOrgIds.indexOf(data.id) === -1) { this.checkOrgIds.push(data.id) } + // 如果与当前人的部门一致 当前人部门选中 + if (this.currentUser.deptId === data.id) { + this.currentUserDeptCheck = true; + } }else { node.expanded = false node.isLeaf = false @@ -510,6 +521,10 @@ if (this.checkOrgIds.indexOf(data.id) !== -1) { // 删除取消勾选节点 this.checkOrgIds.splice(this.checkOrgIds.indexOf(data.id),1) } + // 如果与当前人的部门一致 当前人部门取消选中 + if (this.currentUser.deptId === data.id) { + this.currentUserDeptCheck = false; + } } this.$refs.orgTree.setCheckedKeys(this.checkOrgIds) this.$store.commit('setOrgIds',this.checkOrgIds); @@ -596,6 +611,11 @@ temp = [...this.checkCreateUserIds]; if (val) { temp.push(this.currentUser.userId); + }else { + let index = temp.indexOf(this.currentUser.userId); + if (index !== -1) { + temp.splice(index,1); + } } this.$store.commit('setCreateUsers',temp); // 刷新左侧文件树以及右侧最近编辑与收藏 @@ -719,40 +739,43 @@ that.createUserOptions = that.conditionData.createUsers; that.createUserList = that.createUserOptions; - let checkMethodIdCount = that.conditionData.historyCondition.methodIds.length - let checkCreateUsersCount = that.conditionData.historyCondition.createUsers.length - let index = that.conditionData.historyCondition.createUsers.indexOf(that.currentUser.userId); - if (index !== -1) { - checkCreateUsersCount = checkCreateUsersCount - 1; - that.currentUserCheck = true - }else { - that.currentUserCheck = false - } - that.checkAll = checkMethodIdCount === that.methodIds.length; - that.userCheckAll = checkCreateUsersCount === that.createUserList.length; - that.isIndeterminate = checkMethodIdCount > 0 && checkMethodIdCount < that.methodIds.length; - that.userIndeterminate = checkCreateUsersCount > 0 && checkCreateUsersCount < that.createUserList.length; - // 根据历史筛选条件初始化多选框 - that.checkCreateUserIds = []; - that.conditionData.historyCondition.createUsers.forEach(userId => { - if (userId !== that.currentUser.userId) { - that.checkCreateUserIds.push(userId); + if (that.conditionData.historyCondition) { + + let checkMethodIdCount = that.conditionData.historyCondition.methodIds.length + let checkCreateUsersCount = that.conditionData.historyCondition.createUsers.length + let index = that.conditionData.historyCondition.createUsers.indexOf(that.currentUser.userId); + if (index !== -1) { + checkCreateUsersCount = checkCreateUsersCount - 1; + that.currentUserCheck = true + }else { + that.currentUserCheck = false } - }) - that.checkMethodIds = [...that.conditionData.historyCondition.methodIds]; - that.checkOrgIds = [...that.conditionData.historyCondition.orgIds]; - let orgIdIndex = that.conditionData.historyCondition.orgIds.indexOf(that.currentUser.deptId); - if (orgIdIndex !== -1) { - that.currentUserDeptCheck = true; - }else { - that.currentUserDeptCheck = false; + that.checkAll = checkMethodIdCount === that.methodIds.length; + that.userCheckAll = checkCreateUsersCount === that.createUserList.length; + that.isIndeterminate = checkMethodIdCount > 0 && checkMethodIdCount < that.methodIds.length; + that.userIndeterminate = checkCreateUsersCount > 0 && checkCreateUsersCount < that.createUserList.length; + + that.checkCreateUserIds = []; + that.conditionData.historyCondition.createUsers.forEach(userId => { + if (userId !== that.currentUser.userId) { + that.checkCreateUserIds.push(userId); + } + }) + that.checkMethodIds = [...that.conditionData.historyCondition.methodIds]; + that.checkOrgIds = [...that.conditionData.historyCondition.orgIds]; + let orgIdIndex = that.conditionData.historyCondition.orgIds.indexOf(that.currentUser.deptId); + if (orgIdIndex !== -1) { + that.currentUserDeptCheck = true; + }else { + that.currentUserDeptCheck = false; + } + that.$nextTick(() => { + if (that.$refs.orgTree) { + that.$refs.orgTree.setCheckedKeys(that.checkOrgIds); + } + }) } - that.$nextTick(() => { - if (that.$refs.orgTree) { - that.$refs.orgTree.setCheckedKeys(that.checkOrgIds); - } - }) }, initData() {