Skip to content

Commit

Permalink
Merge pull request #1968 from lhzzforever/dev/ft_ci
Browse files Browse the repository at this point in the history
Dev/ft ci
  • Loading branch information
huangpeng0428 authored May 9, 2023
2 parents dc7764d + 686f768 commit 6211124
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 27 deletions.
6 changes: 4 additions & 2 deletions frontend/src/views/grading-admin/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,15 @@
this.users.forEach(item => {
subjects.push({
type: 'user',
id: item.username
id: item.username,
full_name: item.full_name
});
});
this.departments.forEach(item => {
subjects.push({
type: 'department',
id: item.id
id: item.id,
full_name: item.full_name
});
});
}
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/views/grading-admin/detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,22 @@
departments.push({
name: item.name,
count: item.member_count,
fullName: item.full_name
fullName: item.full_name,
full_name: item.full_name || item.fullName
});
}
if (item.type === 'user') {
users.push({
name: item.name,
username: item.id
username: item.id,
full_name: item.full_name || item.fullName
});
}
if (item.id === '*' && item.type === '*') {
departments.push({
name: this.$t(`m.common['全员']`),
count: 'All'
count: 'All',
full_name: `${this.$t(`m.common['全员']`)}(All)`
});
}
});
Expand Down
18 changes: 11 additions & 7 deletions frontend/src/views/grading-admin/edit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
</bk-button>
<bk-button @click="handleCancel">{{ $t(`m.common['取消']`) }}</bk-button>
</div>

<add-member-dialog
:show.sync="isShowAddMemberDialog"
:users="users"
Expand All @@ -209,7 +208,7 @@
:all-checked="isAll"
show-limit
@on-cancel="handleCancelAdd"
@on-sumbit="handleSumbitAdd" />
@on-sumbit="handleSubmitAdd" />

<add-action-sideslider
:is-show.sync="isShowAddActionSideslider"
Expand Down Expand Up @@ -886,12 +885,13 @@
this.isShowMemberAdd = true;
},
handleSumbitAdd (payload) {
handleSubmitAdd (payload) {
window.changeDialog = true;
const { users, departments } = payload;
this.isAll = payload.isAll;
this.users = _.cloneDeep(users);
this.departments = _.cloneDeep(departments);
console.log(this.users, this.departments);
this.isShowMemberAdd = false;
this.isShowAddMemberDialog = false;
this.isShowMemberEmptyError = false;
Expand All @@ -916,13 +916,15 @@
this.users.forEach(item => {
subjects.push({
type: 'user',
id: item.username
id: item.username,
full_name: item.full_name
});
});
this.departments.forEach(item => {
subjects.push({
type: 'department',
id: item.id
id: item.id,
full_name: item.full_name || item.fullName
});
});
}
Expand Down Expand Up @@ -1003,13 +1005,15 @@
this.users.forEach(item => {
subjects.push({
type: 'user',
id: item.username
id: item.username,
full_name: item.full_name
});
});
this.departments.forEach(item => {
subjects.push({
type: 'department',
id: item.id
id: item.id,
full_name: item.full_name || item.fullName
});
});
}
Expand Down
31 changes: 29 additions & 2 deletions frontend/src/views/group/common/render-member-display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
<span class="name">{{ title }}</span>
</label>
<div class="content">
<!-- <div v-for="(item, index) in data"
:key="index"
class="member-item"
:title="isDepartment ? (
item.fullName ? item.fullName : `${item.name}`) :
item.name !== '' ? `${item.username}(${item.name})` : item.username"> -->
<div v-for="(item, index) in data"
:key="index"
class="member-item"
:title="isDepartment ? (item.fullName ? `${item.fullName}` : `${item.name}`) :
item.name !== '' ? `${item.username}(${item.name})` : item.username">
:title="nameType(item)">
<span class="member-name">
{{ isDepartment ? item.name : item.username }}
</span>
Expand Down Expand Up @@ -54,6 +59,28 @@
},
isEdit () {
return this.mode === 'edit';
},
nameType () {
return (payload) => {
console.log(5555, payload);
const { name, type, username, full_name: fullName } = payload;
const typeMap = {
user: () => {
if (fullName) {
return fullName;
} else {
return name ? `${username}(${name})` : username;
}
},
department: () => {
return fullName || payload.fullName || `${username}(${name})`;
},
depart: () => {
return fullName || payload.fullName || `${username}(${name})`;
}
};
return typeMap[type] ? typeMap[type]() : typeMap['user']();
};
}
},
methods: {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/views/group/components/iam-add-member.vue
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
}
},
depart: () => {
return fullName || name;
return fullName || payload.fullName || name;
}
};
return typeMap[type] ? typeMap[type]() : typeMap['user']();
Expand Down Expand Up @@ -1150,7 +1150,8 @@
child.async = false;
child.isNewMember = false;
child.parentNodeId = payload.id;
child.full_name = `${payload.full_name}/${child.name}`;
// child.full_name = `${payload.full_name}/${child.name}`;
child.full_name = payload.full_name;
// parentNodeId + username 组合成id
child.id = `${child.parentNodeId}${child.username}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,22 @@
departments.push({
name: item.name,
count: item.member_count,
fullName: item.full_name
fullName: item.full_name,
full_name: item.full_name || item.fullName
});
}
if (item.type === 'user') {
users.push({
name: item.name,
username: item.id
username: item.id,
full_name: item.full_name || item.fullName
});
}
if (item.id === '*' && item.type === '*') {
departments.push({
name: this.$t(`m.common['全员']`),
count: 'All'
count: 'All',
full_name: `${this.$t(`m.common['全员']`)}(All)`
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
}
},
depart: () => {
return fullName || name;
return fullName || payload.fullName || name;
}
};
return typeMap[type] ? typeMap[type]() : typeMap['user']();
Expand Down Expand Up @@ -1087,7 +1087,8 @@
child.async = child.child_count > 0 || child.member_count > 0;
child.isNewMember = false;
child.parentNodeId = payload.id;
child.full_name = `${payload.full_name}/${child.name}`;
// child.full_name = `${payload.full_name}/${child.name}`;
child.full_name = payload.full_name;
if (this.hasSelectedDepartments.length > 0) {
child.is_selected = this.hasSelectedDepartments.map(item => item.id).includes(child.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,22 @@
departments.push({
name: item.name,
count: item.member_count,
fullName: item.full_name
fullName: item.full_name,
full_name: item.full_name || item.fullName
});
}
if (item.type === 'user') {
users.push({
name: item.name,
username: item.id
username: item.id,
full_name: item.full_name || item.fullName
});
}
if (item.id === '*' && item.type === '*') {
departments.push({
name: this.$t(`m.common['全员']`),
count: 'All'
count: 'All',
full_name: `${this.$t(`m.common['全员']`)}(All)`
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,8 @@
child.async = child.child_count > 0 || child.member_count > 0;
child.isNewMember = false;
child.parentNodeId = payload.id;
child.full_name = `${payload.full_name}/${child.name}`;
// child.full_name = `${payload.full_name}/${child.name}`;
child.full_name = payload.full_name;
if (this.hasSelectedDepartments.length > 0) {
child.is_selected = this.hasSelectedDepartments.map(item => item.id).includes(child.id);
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/views/my-manage-space/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -896,13 +896,15 @@
this.users.forEach((item) => {
subjects.push({
type: 'user',
id: item.username
id: item.username,
full_name: item.full_name
});
});
this.departments.forEach((item) => {
subjects.push({
type: 'department',
id: item.id
id: item.id,
full_name: item.full_name || item.fullName
});
});
}
Expand Down

0 comments on commit 6211124

Please sign in to comment.