mirror of https://github.com/halo-dev/halo-admin
refactor: group change
parent
a67e84ac88
commit
2a6e50ab49
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -177,6 +177,7 @@ watch(
|
|||
);
|
||||
|
||||
onMounted(async () => {
|
||||
await handleFetchGroups();
|
||||
if (routeQuery.value && !props.readonly) {
|
||||
const allGroups = [...defaultGroups, ...(groups.value || [])];
|
||||
const group = allGroups.find(
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue