Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 1、审计日志中新增人员全名列&导出列表优化 #618 2、通过excel导入用户组织支持全量更新 #728 #836

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/pages/src/components/catalog/home/ImportUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
<span class="text">{{$t('仅支持xls、xlsx格式文件')}}</span>
<span class="template" @click="downloadTemplate"><i class="icon-user-download"></i>{{$t('下载模板')}}</span>
</p>
<p class="tip-wrapper">
<bk-checkbox
v-model="uploadInfo.isOverwrite">
允许对同名用户覆盖更新
</bk-checkbox>
<i class="tip-icon icon-user--l" v-bk-tooltips="{ width: 310, content: $t('导入覆盖提升') }"></i>
</p>
</div>
</template>

Expand All @@ -69,6 +76,7 @@ export default {
name: '',
size: '',
type: false,
isOverwrite: false,
},
};
},
Expand Down Expand Up @@ -116,6 +124,7 @@ export default {
name: '',
size: '',
type: false,
isOverwrite: false,
};
},
// 上传
Expand Down Expand Up @@ -307,4 +316,12 @@ export default {
cursor: pointer;
}
}

.tip-wrapper {
margin-top: 10px;
.tip-icon {
display: inline-block;
transform: translateY(4px);
}
}
</style>
3 changes: 3 additions & 0 deletions src/pages/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ export default {
最近三个月: 'Last 3 months',
时间: 'Time',
操作人员: 'The operator',
操作用户: 'The operator',
用户全名: 'Full name',
操作对象: 'Action object',
操作类型: 'Operation type',
用户目录管理无权限访问: '【Categories Management】No access authority',
Expand Down Expand Up @@ -446,4 +448,5 @@ export default {
退出登录: 'Log out',
确认退出登录_: '确认退出登录?',
_需要设置新密码: ', You need to set a new password',
导入覆盖提升: 'After checking, it is allowed to edit the personal information of existing users, and the existing user information will face the risk of being modified, so be cautious.',
};
3 changes: 3 additions & 0 deletions src/pages/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ export default {
最近三个月: '最近三个月',
时间: '时间',
操作人员: '操作人员',
操作用户: '操作用户',
用户全名: '用户全名',
操作对象: '操作对象',
操作类型: '操作类型',
用户目录管理无权限访问: '【用户目录管理】无权限访问',
Expand Down Expand Up @@ -445,4 +447,5 @@ export default {
退出登录: '退出登录',
确认退出登录_: '确认退出登录?',
_需要设置新密码: ',需要设置新密码',
导入覆盖提升: '勾选后,将允许对已经存在用户的个人信息进行编辑操作,现存用户信息将面临被修改风险,谨慎操作。',
};
2 changes: 1 addition & 1 deletion src/pages/src/store/modules/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {
},
// eslint-disable-next-line no-unused-vars
ajaxImportUser(_context, params, _config = {}) {
return http.post(`api/v1/web/categories/${params.id}/operations/sync_or_import/`, params.data);
return http.post(`api/v1/web/categories/${params.id}/operations/sync_or_import/?is_overwrite=${params.isOverwrite}`, params.data);
// const mockUrl = `?mock-file=catalog`
// return http.get(mockUrl, config)
},
Expand Down
8 changes: 6 additions & 2 deletions src/pages/src/views/audit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
v-if="panelActive === 'operate'"
class="king-input-search"
style="width: 400px;"
:placeholder="$t('搜索操作人员、操作对象、操作类型')"
:placeholder="$t('搜索操作用户、操作对象、操作类型')"
:clearable="true"
:left-icon="'bk-icon icon-search'"
@clear="handleClear"
Expand Down Expand Up @@ -71,6 +71,7 @@
<tr v-for="(item, index) in auditList" :key="index">
<template v-if="isOperate">
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.operator}}</div></td>
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.display_name || '--'}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime | convertIsoTime}}</div></td>
<td><div class="text-overflow-hidden" v-bk-overflow-tips>{{item.client_ip}}</div></td>
<td><div class="text-overflow-hidden">{{item.operation}}</div></td>
Expand All @@ -79,6 +80,7 @@
</template>
<template v-else>
<td><div class="text-overflow-hidden">{{item.username}}</div></td>
<td><div class="text-overflow-hidden">{{item.display_name || '--'}}</div></td>
<td><div class="text-overflow-hidden">{{item.datetime | convertIsoTime}}</div></td>
<td><div class="text-overflow-hidden">{{item.client_ip}}</div></td>
<td><div class="text-overflow-hidden" v-bk-tooltips="errorTips(item)">
Expand Down Expand Up @@ -191,7 +193,8 @@ export default {
],
panelActive: 'operate',
auditHead: [
{ key: 'operater', name: this.$t('操作人员') },
{ key: 'operater', name: this.$t('操作用户') },
{ key: 'operater', name: this.$t('用户全名') },
{ key: 'time', name: this.$t('时间') },
{ key: 'IP', name: this.$t('来源 IP') },
{ key: 'type', name: this.$t('操作类型') },
Expand All @@ -201,6 +204,7 @@ export default {
/** 登录审计表头 */
loginHead: [
{ key: 'user', name: this.$t('登录用户') },
{ key: 'user', name: this.$t('用户全名') },
{ key: 'time', name: this.$t('登录时间') },
{ key: 'IP', name: this.$t('登录来源IP') },
{ key: 'status', name: this.$t('登录状态') },
Expand Down
6 changes: 4 additions & 2 deletions src/pages/src/views/catalog/PageHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,9 @@ export default {
return;
}
const formData = new FormData();
formData.append('file', this.$refs.importUserRef.uploadInfo.fileInfo);
formData.append('file_name', this.$refs.importUserRef.uploadInfo.name);
const uploadInfo = this.$refs.importUserRef.uploadInfo;
formData.append('file', uploadInfo.fileInfo);
formData.append('file_name', uploadInfo.name);
formData.append('department_id', this.$refs.importUserRef.id);

// 如果同时有两个目录正在导入,this.importId 会变化,影响 splice loading,所以必须加个变量
Expand All @@ -380,6 +381,7 @@ export default {
try {
await this.$store.dispatch('catalog/ajaxImportUser', {
id: this.importId,
isOverwrite: uploadInfo.isOverwrite,
data: formData,
});
await this.getDepartments();
Expand Down