Skip to content

Commit

Permalink
fix: 体验问题修复 (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 authored Nov 10, 2023
1 parent 280112f commit 5849c5b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
26 changes: 11 additions & 15 deletions src/pages/src/views/data-source/local-details/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,6 @@ const isDataEmpty = ref(false);
const isEmptySearch = ref(false);
const isDataError = ref(false);
const params = reactive({
id: props.dataSourceId,
username: '',
page: 1,
pageSize: 10,
});
const pagination = reactive({
current: 1,
count: 0,
Expand All @@ -310,9 +303,15 @@ const getUsers = async () => {
isDataEmpty.value = false;
isEmptySearch.value = false;
isDataError.value = false;
const params = {
id: props.dataSourceId,
username: searchVal.value,
page: pagination.current,
pageSize: pagination.limit,
};
const res = await getDataSourceUsers(params);
if (res.data.count === 0) {
params.username === '' ? isDataEmpty.value = true : isEmptySearch.value = true;
searchVal.value === '' ? isDataEmpty.value = true : isEmptySearch.value = true;
}
pagination.count = res.data.count;
users.value = res.data.results;
Expand Down Expand Up @@ -360,7 +359,7 @@ const handleBeforeClose = async () => {
const updateUsers = (value, text) => {
detailsConfig.isShow = false;
params.username = value;
searchVal.value = value;
getUsers();
Message({
theme: 'success',
Expand All @@ -369,26 +368,23 @@ const updateUsers = (value, text) => {
};
const handleEnter = () => {
params.username = searchVal.value;
params.page = 1;
pagination.current = 1;
getUsers();
};
const handleClear = () => {
searchVal.value = '';
params.username = '';
pagination.current = 1;
getUsers();
};
const pageLimitChange = (limit) => {
pagination.limit = limit;
params.pageSize = limit;
params.page = 1;
pagination.current = 1;
getUsers();
};
const pageCurrentChange = (current) => {
pagination.current = current;
params.page = current;
getUsers();
};
Expand Down
7 changes: 5 additions & 2 deletions src/pages/src/views/personal-center/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
<div class="left-natural-user">
<div class="natural-user">
<i class="bk-sq-icon icon-personal-user" />
<span class="name">{{ currentNaturalUser.full_name }}</span>
<bk-overflow-title type="tips" class="name">
{{ currentNaturalUser.full_name }}
</bk-overflow-title>
<bk-overflow-title type="tips" class="id">
({{ currentNaturalUser.id }})
</bk-overflow-title>
Expand Down Expand Up @@ -409,13 +411,14 @@ const changeCountryCode = (code: string) => {
}
.name {
max-width: 120px;
margin-left: 8px;
font-size: 14px;
font-weight: 700;
}
.id {
max-width: 200px;
min-width: 120px;
color: #979BA5;
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/src/views/tenant/group-details/OperationDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,14 @@ const files = computed(() => {
});
const isEdit = computed(() => props.type === "edit");
watch(() => props.type, () => {
if (props.tenantsData.managers.length > 0) {
formData.managers = props.tenantsData.managers;
watch(() => props.tenantsData.managers, (value) => {
if (value.length > 0) {
formData.managers = value;
} else {
formData.managers.splice(1, 0, getTableItem());
nextTick(() => {
fetchUserList('');
});
}
}, {
deep: true,
Expand Down

0 comments on commit 5849c5b

Please sign in to comment.