Skip to content

Commit f084e68

Browse files
ba1q1fit2-zhao
authored andcommitted
fix: followListRepeatLoad
1 parent 35ad4e9 commit f084e68

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

frontend/packages/web/src/components/business/crm-follow-detail/index.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,6 @@
329329
}
330330
}
331331
332-
onBeforeMount(() => {
333-
loadFollowList(true);
334-
});
335-
336332
watch(
337333
() => props.refreshKey,
338334
(val) => {
@@ -341,6 +337,14 @@
341337
}
342338
}
343339
);
340+
341+
watch(
342+
() => props.activeType,
343+
() => {
344+
loadFollowList(true);
345+
},
346+
{ immediate: true }
347+
);
344348
</script>
345349

346350
<style lang="less" scoped>

frontend/packages/web/src/components/business/crm-follow-detail/useFollowApi.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,6 @@ export default function useFollowApi(followProps: {
270270
}
271271
}
272272

273-
watch(
274-
() => type.value,
275-
(val) => {
276-
if (['followPlan', 'followRecord'].includes(val)) {
277-
loadFollowList(true);
278-
}
279-
}
280-
);
281-
282273
return {
283274
data,
284275
loading,

frontend/packages/web/src/components/business/crm-overview-drawer/index.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,15 @@
219219
}
220220
);
221221
222+
watch(
223+
() => showDrawer.value,
224+
(val) => {
225+
if (!val) {
226+
activeTab.value = cachedList.value[0]?.name as string;
227+
}
228+
}
229+
);
230+
222231
defineExpose({
223232
layout,
224233
});

frontend/packages/web/src/views/customer/components/customerOverviewDrawer.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
:form-key="FormDesignKeyEnum.CUSTOMER_CONTACT"
4646
/>
4747
<FollowDetail
48-
v-else-if="['followRecord', 'followPlan'].includes(activeTab)"
48+
v-else-if="['followRecord', 'followPlan'].includes(activeTab) && show"
4949
:active-type="(activeTab as 'followRecord'| 'followPlan')"
5050
wrapper-class="h-[calc(100vh-162px)]"
5151
virtual-scroll-height="calc(100vh - 254px)"
@@ -109,7 +109,6 @@
109109
110110
import CrmCard from '@/components/pure/crm-card/index.vue';
111111
import type { ActionsItem } from '@/components/pure/crm-more-action/type';
112-
import FollowDetail from '@/components/business/crm-follow-detail/index.vue';
113112
import ContactTable from '@/components/business/crm-form-create-table/contactTable.vue';
114113
import CrmFormDescription from '@/components/business/crm-form-description/index.vue';
115114
import CrmHeaderTable from '@/components/business/crm-header-table/index.vue';
@@ -125,6 +124,8 @@
125124
import useModal from '@/hooks/useModal';
126125
import { hasAnyPermission } from '@/utils/permission';
127126
127+
const FollowDetail = defineAsyncComponent(() => import('@/components/business/crm-follow-detail/index.vue'));
128+
128129
const props = defineProps<{
129130
sourceId: string;
130131
readonly?: boolean;

0 commit comments

Comments
 (0)