Skip to content

Commit

Permalink
Merge pull request #298 from TencentBlueKing/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zhu327 authored Oct 22, 2021
2 parents bda6731 + 2121ddd commit 33c8f4f
Showing 1 changed file with 6 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,10 @@
v-bkloading="{ isLoading, opacity: 1 }">
<render-tab
v-if="!isLoading && showMember"
:active.sync="tabActive"
ext-cls="set-tab-margin-bottom"
@on-change="handleTabChange" />
<section v-show="isPerm">
<!-- <template v-if="groupTemplateList.length && !isLoading">
<render-perm-item
v-for="(groupTemplate, groupTemplateIndex) in groupTemplateList"
:key="groupTemplate.id"
:expanded.sync="groupTemplate.expanded"
:ext-cls="groupTemplateIndex > 0 ? 'iam-perm-ext-cls' : ''"
:title="groupTemplate.displayName">
<detail-table :template-id="groupTemplate.id" :system-id="groupTemplate.system.id"
:version="groupTemplate.version" />
</render-perm-item>
</template>
<template v-if="!groupTemplateList.length && !isLoading">
<div class="iam-my-perm-empty-wrapper">
<iam-svg />
</div>
</template> -->
<render-group-perm
:id="groupId"
mode="detail"
@on-init="handleOnInit" />
</section>
<section v-show="!isPerm">
<render-member-item :data="userList" type="user" v-if="userList.length > 0" />
<render-member-item :data="departmentList" type="department" v-if="departmentList.length > 0" />
<div class="iam-group-member-empty-wrapper" v-if="isEmpty">
<iam-svg />
</div>
:active="'perm'"
ext-cls="set-tab-margin-bottom" />
<section>
<render-group-perm :id="groupId" mode="detail" @on-init="handleOnInit" />
</section>
</div>
</bk-sideslider>
Expand All @@ -55,15 +28,11 @@
// import RenderPermItem from '../group-perm/render-perm'
// import DetailTable from '../group-perm/detail-table'
import RenderTab from '../group-perm/render-tab'
import RenderMemberItem from '../components/render-member'
import renderGroupPerm from '../../group/detail/group-perm-new'
export default {
name: '',
components: {
// RenderPermItem,
// DetailTable,
RenderTab,
RenderMemberItem,
renderGroupPerm
},
props: {
Expand Down Expand Up @@ -92,21 +61,12 @@
return {
groupTemplateList: [],
isShowSideslider: false,
requestQueue: ['list', 'member'],
tabActive: 'perm',
userList: [],
departmentList: []
requestQueue: ['list']
}
},
computed: {
isLoading () {
return this.requestQueue.length > 0
},
isPerm () {
return this.tabActive === 'perm'
},
isEmpty () {
return this.userList.length < 1 && this.departmentList.length < 1
}
},
watch: {
Expand All @@ -115,7 +75,6 @@
this.isShowSideslider = !!value
if (this.isShowSideslider) {
// this.fetchPermList()
this.fetchMemberList()
}
},
immediate: true
Expand Down Expand Up @@ -154,40 +113,9 @@
// this.isLoading = flag
},
async fetchMemberList () {
try {
const params = {
id: this.groupId,
limit: 1000,
offset: 0
}
const res = await this.$store.dispatch('userGroup/getUserGroupMemberList', params)
this.userList = res.data.results.filter(item => item.type === 'user')
this.departmentList = res.data.results.filter(item => item.type !== 'user')
} catch (e) {
console.error(e)
this.bkMessageInstance = this.$bkMessage({
limit: 1,
theme: 'error',
message: e.message || e.data.msg || e.statusText,
ellipsisLine: 2,
ellipsisCopy: true
})
} finally {
this.requestQueue.shift()
}
},
handleTabChange (payload) {
this.tabActive = payload
},
handleAnimationEnd () {
// this.groupTemplateList = []
this.userList = []
this.departmentList = []
this.tabActive = 'perm'
this.requestQueue = ['list', 'member']
this.requestQueue = ['list']
this.$emit('animation-end')
}
}
Expand Down

0 comments on commit 33c8f4f

Please sign in to comment.