Skip to content

Commit

Permalink
feat: 修复编辑基础信息弹框中维护人员不回显的问题 (#703)
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 10102
  • Loading branch information
ielgnaw authored Jun 19, 2024
1 parent 3e41916 commit d452536
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/dashboard-front/src/components/member-select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useStaffStore } from '@/store';
import { Staff, StaffType } from '@/types';
import { Loading, TagInput } from 'bkui-vue';
import { computed, defineComponent, onMounted, PropType, ref, watch, nextTick } from 'vue';
import { computed, defineComponent, PropType, ref, watch, nextTick } from 'vue';
import _ from 'lodash';

import './member-select.scss';
Expand Down Expand Up @@ -39,6 +39,7 @@ export default defineComponent({
emits: ['change', 'input', 'blur', 'focus'],
setup(props, ctx) {
const tagInputRef = ref(null);
// const isLoading = ref(false);
const staffStore = useStaffStore();
const searchKey = ['username'];
const userList: any = ref([]);
Expand All @@ -50,11 +51,11 @@ export default defineComponent({
// fixOnBoundary: true,
};

onMounted(() => {
if (staffStore.list.length === 0) {
staffStore.fetchStaffs();
}
});
// onMounted(() => {
// if (staffStore.list.length === 0) {
// staffStore.fetchStaffs();
// }
// });

function tpl(node: Staff) {
return (
Expand Down Expand Up @@ -92,15 +93,20 @@ export default defineComponent({
() => staffStore.list,
(list) => {
if (list.length) {
// isLoading.value = false;
nextTick(() => {
userList.value = _.cloneDeep(list);
});
} else {
// isLoading.value = true;
staffStore.fetchStaffs();
}
},
{ immediate: true, deep: true },
);

return () => (
return () => <>
{/* v-bkloading={{ loading: isLoading, opacity: 1, color: '#fff', mode: 'spin', size: 'mini' }} */}
<TagInput
{...ctx.attrs}
{...maxData.value}
Expand Down Expand Up @@ -135,6 +141,6 @@ export default defineComponent({
),
}}
</TagInput>
);
</>;
},
});
1 change: 1 addition & 0 deletions src/dashboard-front/src/store/staff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const useStaffStore = defineStore({
if (result) {
this.fetching = false;
this.list = _.unionBy(this.list, data.results, 'id');
console.log('staffs', this.list.length);
}
headTag.removeChild(scriptTag);
// @ts-ignore
Expand Down

0 comments on commit d452536

Please sign in to comment.