Skip to content

Commit

Permalink
optimization: 个人详情增加登录时间/组织拓扑搜索优化 TencentBlueKing#73
Browse files Browse the repository at this point in the history
  • Loading branch information
v_yutyi committed Oct 21, 2021
1 parent d65be3f commit 518283c
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 23 deletions.
14 changes: 14 additions & 0 deletions src/pages/src/views/organization/details/UserMaterial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@
<span class="text">{{passwordValidDays}}</span>
</p>
</div>
<div class="specific-text">
<span class="name">{{$t('创建时间')}}</span>
<span class="gap">:</span>
<p class="desc">
<span class="text">{{currentProfile.create_time}}</span>
</p>
</div>
<div class="specific-text">
<span class="name">{{$t('最近一次登录时间')}}</span>
<span class="gap">:</span>
<p class="desc">
<span class="text">{{currentProfile.update_time}}</span>
</p>
</div>
</li>
</ul>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/src/views/organization/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ import PullUser from './table/PullUser';
import DetailsBar from './details/DetailsBar';

import SetDepartment from '@/components/organization/SetDepartment';
import moment from 'moment';

export default {
components: {
Expand Down Expand Up @@ -548,6 +549,14 @@ export default {
{
key: 'departments',
name: 'departments',
},
{
key: 'create_time',
name: 'create_time',
},
{
key: 'update_time',
name: 'update_time',
}
);
this.userMessage.tableHeardList = tableHeardList;
Expand Down Expand Up @@ -873,6 +882,8 @@ export default {

// 查看当前用户的信息
viewDetails(item) {
item.create_time = moment(item.create_time).format('YYYY-MM-DD HH:mm:ss');
item.update_time = moment(item.update_time).format('YYYY-MM-DD HH:mm:ss');
this.currentProfile = item;
this.detailsBarInfo.type = 'view';
this.detailsBarInfo.title = this.currentProfile.display_name;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/organization/table/UserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default {
},
computed: {
activeTableHeardList() {
const arr = ['id', 'isCheck', 'departments'];
const arr = ['id', 'isCheck', 'departments', 'create_time', 'update_time'];
return this.userMessage.tableHeardList.filter(item => arr.indexOf(item.key) === -1);
},
enumInfo() {
Expand Down
72 changes: 50 additions & 22 deletions src/pages/src/views/organization/tree/TreeSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@
:key="'department' + index"
:class="{ 'active': (activeType === 'department' && activeIndex === index) }"
@click="handleSelect(item)">
<p class="item-title">{{ item.name }}</p>
<p class="item-detail">{{ getDepartmentDetail(item) }}</p>
<div class="match-item-left">
<p class="item-title">{{ item.name }}</p>
<p class="item-detail">{{ getDepartmentDetail(item) }}</p>
</div>
<bk-button
title="disabled"
:disabled="true"
class="match-item-right"
v-if="!item.enabled">{{ $t('已删除') }}</bk-button>
</li>
</ul>
</div>
Expand All @@ -98,11 +105,18 @@
:key="'user' + index"
:class="{ 'active': (activeType === 'user' && activeIndex === index) }"
@click="handleSelect(item)">
<p class="item-title">
{{ item.username + '(' + item.display_name + ') ' }}
<span class="category-label">{{item.category_name}}</span>
</p>
<p class="item-detail">{{ getUserDetail(item) }}</p>
<div class="match-item-left">
<p class="item-title">
{{ item.username + '(' + item.display_name + ') ' }}
<span class="category-label">{{item.category_name}}</span>
</p>
<p class="item-detail">{{ getUserDetail(item) }}</p>
</div>
<bk-button
title="disabled"
:disabled="true"
class="match-item-right"
v-if="item.status !== 'NORMAL'">{{ getStatus(item.status) }}</bk-button>
</li>
</ul>
</div>
Expand Down Expand Up @@ -163,6 +177,14 @@ export default {
}
return `${groupName}:${itemInfo[groupType]}`;
},
getStatus(status) {
switch (status) {
case 'LOCKED':
return '被冻结';
case 'DISABLED':
return '被禁用';
}
},
dealDepartmentPath(path) {
const length = path.length;
// 目前的宽度最多展示28个汉字
Expand Down Expand Up @@ -536,27 +558,33 @@ export default {
display: block;
padding: 10px 20px 12px;
cursor: pointer;

display: flex;
justify-content: space-between;
align-items: center;
&.active,
&:hover {
background: #e1ecff;
}

.item-title {
margin-bottom: 4px;
font-weight: bold;
color: #63656e;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

.category-label {
font-weight: normal;
background: #f0f1f5;
padding: 2px 4px;
.match-item-left {
.item-title {
margin-bottom: 4px;
font-weight: bold;
color: #63656e;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

.category-label {
font-weight: normal;
background: #f0f1f5;
padding: 2px 4px;
}
}
}

.match-item-right {
color: #aaa;
background-color: rgba(242, 242, 242, 1);
}
.item-detail {
overflow: hidden;
text-overflow: ellipsis;
Expand Down

0 comments on commit 518283c

Please sign in to comment.