Skip to content

Commit

Permalink
fix: 修复【用户管理】组织架构搜索用户时,搜索范围不是当前目录,而是全局的问题&组织架构中仅显示本级组织成员选项,数字未及时更新问题&…
Browse files Browse the repository at this point in the history
…文案修改 (#1894)
  • Loading branch information
867-Jige authored Aug 15, 2024
1 parent 007100d commit fdb07d9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
13 changes: 9 additions & 4 deletions src/pages/src/store/modules/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ export default {

// 用户列表,分页查询接口
getProfiles(context, params, config = {}) {
const { id, pageSize, page, keyword, recursive } = params;
return keyword
? http.get(`api/v1/web/departments/${id}/profiles/?page_size=${pageSize}&page=${page}&recursive=${recursive}&keyword=${keyword}`)
: http.get(`api/v1/web/departments/${id}/profiles/?page_size=${pageSize}&page=${page}&recursive=${recursive}`);
const { id, pageSize, page, keyword, recursive, values } = params;
let url = `api/v1/web/departments/${id}/profiles/?page_size=${pageSize}&page=${page}&recursive=${recursive}`;
if (keyword) {
url += `&keyword=${keyword}`;
}
if (values) {
url += `&${values}`;
}
return http.get(url);
},
// 新增用户
postProfile(context, params, config = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/audit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default {
auditList: [],
shortcuts: [
{
text: this.$t('昨天'),
text: this.$t('最近一天'),
value() {
const start = new Date();
start.setTime(start.getTime() - 86400000);
Expand Down
28 changes: 19 additions & 9 deletions src/pages/src/views/organization/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -641,16 +641,17 @@ export default {
if (this.treeSearchResult && this.treeSearchResult.groupType === 'department') {
id = this.treeSearchResult.id;
}
const recursive = !this.isSearchCurrentDepartment;
const params = {
id: id || this.currentParam.item.id,
pageSize: this.paginationConfig.limit,
page: this.paginationConfig.current,
keyword: this.checkSearchKey,
recursive: !this.isSearchCurrentDepartment,
recursive,
};
const res = await this.$store.dispatch('organization/getProfiles', params);
this.handleTabData.totalNumber = res.data.count;
this.handleTabData.currentNumber = res.data.count;
this.handleTabData.currentNumber = recursive ? res.data.current_count : res.data.count;
this.isTableDataEmpty = false;
this.isEmptySearch = false;
this.isTableDataError = false;
Expand Down Expand Up @@ -746,8 +747,17 @@ export default {
if (!list.length) return this.handleClickEmpty();
if (!this.searchFilterList.length) return;
this.basicLoading = true;
const valueList = [`category_id=${this.currentCategoryId}&page=${current}&page_size=${this.paginationConfig.limit}`];
let id = '';
if (this.treeSearchResult && this.treeSearchResult.groupType === 'department') {
id = this.treeSearchResult.id;
}
const params = {
id: id || this.currentParam.item.id,
page: current,
pageSize: this.paginationConfig.limit,
recursive: true,
};
const values = [];
list.forEach((item) => {
if (!Array.isArray(item.values)) {
const { id, name } = item;
Expand All @@ -765,16 +775,16 @@ export default {
item.values.forEach((v) => {
value.push(v.id);
});
valueList.push(`${key}=${value}`);
values.push(`${key}=${value}`);
});
const params = valueList.join('&');
this.$store.dispatch('organization/getMultiConditionQuery', params).then((res) => {
params.values = values.join('&');
this.$store.dispatch('organization/getProfiles', params).then((res) => {
if (res.result) {
this.basicLoading = false;
this.isEmptySearch = res.data.count === 0;
this.handleTabData.currentNumber = res.data.current_count;
this.paginationConfig.count = res.data.count;
this.filterUserData(res.data.results);
this.filterUserData(res.data.data);
}
})
.catch((e) => {
Expand Down

0 comments on commit fdb07d9

Please sign in to comment.