mirror of https://github.com/halo-dev/halo-admin
refactor: group change
parent
a67e84ac88
commit
2a6e50ab49
|
@ -220,11 +220,6 @@ const onUploadModalClose = () => {
|
||||||
handleFetchAttachments();
|
handleFetchAttachments();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onGroupChange = () => {
|
|
||||||
handleReset();
|
|
||||||
handleFetchAttachments();
|
|
||||||
};
|
|
||||||
|
|
||||||
const getPolicyName = (name: string | undefined) => {
|
const getPolicyName = (name: string | undefined) => {
|
||||||
const policy = policies.value?.find((p) => p.metadata.name === name);
|
const policy = policies.value?.find((p) => p.metadata.name === name);
|
||||||
return policy?.spec.displayName;
|
return policy?.spec.displayName;
|
||||||
|
@ -565,7 +560,7 @@ onMounted(() => {
|
||||||
<div :style="`${viewType === 'list' ? 'padding:12px 16px 0' : ''}`">
|
<div :style="`${viewType === 'list' ? 'padding:12px 16px 0' : ''}`">
|
||||||
<AttachmentGroupList
|
<AttachmentGroupList
|
||||||
v-model:selected-group="selectedGroup"
|
v-model:selected-group="selectedGroup"
|
||||||
@select="onGroupChange"
|
@select="handleReset"
|
||||||
@update="handleFetchGroups"
|
@update="handleFetchGroups"
|
||||||
@reload-attachments="handleFetchAttachments"
|
@reload-attachments="handleFetchAttachments"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -177,6 +177,7 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
await handleFetchGroups();
|
||||||
if (routeQuery.value && !props.readonly) {
|
if (routeQuery.value && !props.readonly) {
|
||||||
const allGroups = [...defaultGroups, ...(groups.value || [])];
|
const allGroups = [...defaultGroups, ...(groups.value || [])];
|
||||||
const group = allGroups.find(
|
const group = allGroups.find(
|
||||||
|
|
|
@ -66,17 +66,12 @@ const handleOpenDetail = (attachment: Attachment) => {
|
||||||
selectedAttachment.value = attachment;
|
selectedAttachment.value = attachment;
|
||||||
detailVisible.value = true;
|
detailVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onGroupChange = () => {
|
|
||||||
handleReset();
|
|
||||||
handleFetchAttachments();
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<AttachmentGroupList
|
<AttachmentGroupList
|
||||||
v-model:selected-group="selectedGroup"
|
v-model:selected-group="selectedGroup"
|
||||||
readonly
|
readonly
|
||||||
@select="onGroupChange"
|
@select="handleReset"
|
||||||
/>
|
/>
|
||||||
<div v-if="attachments?.length" class="mb-5">
|
<div v-if="attachments?.length" class="mb-5">
|
||||||
<VButton @click="uploadVisible = true">
|
<VButton @click="uploadVisible = true">
|
||||||
|
|
Loading…
Reference in New Issue