Skip to content

Commit

Permalink
fix: 组织架构选择器不使用 fe_list_department_profiles API (#1624)
Browse files Browse the repository at this point in the history
  • Loading branch information
leafage-collb authored Sep 24, 2024
1 parent 9c59460 commit bbcb4a2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
9 changes: 5 additions & 4 deletions webfe/package_vue/src/components/user-selector/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export default {
],
searchConditionValue: 'fuzzy',
isConfirmLoading: false,
userApi: '',
departmentApi: '',
};
},
computed: {
Expand Down Expand Up @@ -283,9 +285,8 @@ export default {
},
apiHost: {
handler(value) {
this.userApi = `${value}/api/c/compapi/v2/usermanage/fe_list_department_profiles/`;
this.userApi = `${value}/api/c/compapi/v2/usermanage/fs_list_users/`;
this.departmentApi = `${value}/api/c/compapi/v2/usermanage/fe_list_departments/`;
this.userSearchApi = `${value}/api/c/compapi/v2/usermanage/fe_list_users/`;
},
immediate: true,
},
Expand All @@ -312,7 +313,7 @@ export default {
},
fetchSearchUser(params = {}) {
return request.getData(this.userSearchApi, params);
return request.getData(this.userApi, params);
},
async fetchCategories(isTreeLoading = false, isDialogLoading = false) {
Expand Down Expand Up @@ -504,7 +505,7 @@ export default {
};
const requestUserParams = {
...params,
lookup_value: payload.id,
extra_lookups: payload.id,
};
try {
Expand Down
4 changes: 2 additions & 2 deletions webfe/package_vue/src/components/user-selector/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function JSONP(api, params = {}, options = {}) {
resolve(response);
};
const script = document.createElement('script');
script.onerror = (event) => {
script.onerror = () => {
document.body.removeChild(script);
delete window[callbackName];
reject('Get data failed.');
Expand Down Expand Up @@ -57,7 +57,7 @@ const request = {
if (response.code !== 0) {
throw new Error(response);
}
data = response.data;
data = Array.isArray(response.data) ? response.data : response.data.results;
} catch (error) {
console.error(error.message);
data = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="render-member-list-wrapper">
<div :class="['render-member-list-wrapper', { 'default-style': !customStyles }]">
<div class="content">
<div
v-for="(item, index) in data"
Expand Down Expand Up @@ -38,11 +38,22 @@ export default {
type: String,
default: 'user',
},
customStyles: {
type: String,
default: false,
},
},
};
</script>
<style lang="scss" scoped>
.render-member-list-wrapper {
&.default-style {
margin-top: 12px;
padding: 12px 12px 12px 36px;
background: #f5f7fa;
border-radius: 2px;
}
font-size: 12px;
color: #63656e;
.content {
.icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
<render-member-list
v-if="departments.length > 0"
type="department"
:custom-styles="true"
:data="departments"
/>
<render-member-list
v-if="users.length > 0"
:custom-styles="true"
:data="users"
/>
</div>
Expand Down

0 comments on commit bbcb4a2

Please sign in to comment.