refactor: group change

pull/878/head
Ryan Wang 2023-02-23 11:08:57 +08:00
parent a67e84ac88
commit 2a6e50ab49
3 changed files with 3 additions and 12 deletions

View File

@ -220,11 +220,6 @@ const onUploadModalClose = () => {
handleFetchAttachments();
};
const onGroupChange = () => {
handleReset();
handleFetchAttachments();
};
const getPolicyName = (name: string | undefined) => {
const policy = policies.value?.find((p) => p.metadata.name === name);
return policy?.spec.displayName;
@ -565,7 +560,7 @@ onMounted(() => {
<div :style="`${viewType === 'list' ? 'padding:12px 16px 0' : ''}`">
<AttachmentGroupList
v-model:selected-group="selectedGroup"
@select="onGroupChange"
@select="handleReset"
@update="handleFetchGroups"
@reload-attachments="handleFetchAttachments"
/>

View File

@ -177,6 +177,7 @@ watch(
);
onMounted(async () => {
await handleFetchGroups();
if (routeQuery.value && !props.readonly) {
const allGroups = [...defaultGroups, ...(groups.value || [])];
const group = allGroups.find(

View File

@ -66,17 +66,12 @@ const handleOpenDetail = (attachment: Attachment) => {
selectedAttachment.value = attachment;
detailVisible.value = true;
};
const onGroupChange = () => {
handleReset();
handleFetchAttachments();
};
</script>
<template>
<AttachmentGroupList
v-model:selected-group="selectedGroup"
readonly
@select="onGroupChange"
@select="handleReset"
/>
<div v-if="attachments?.length" class="mb-5">
<VButton @click="uploadVisible = true">