feat(ui): implement dashboard layout and refactor pages
This commit replaces the previous simple layout with a comprehensive dashboard interface using Nuxt UI Pro components. - Introduced a new default layout with `UDashboardSidebar` and `UDashboardPanel`. - Refactored the main page (`index.vue`) by splitting it into `ItemManageStatistics` and `ItemManageTable` components. - Added new computed stats for monthly growth and total images, and displayed them in new statistic cards. - Reorganized components from `item/` to a new `itemManage/` directory. - Added custom primary and secondary theme colors.
This commit is contained in:
53
app/components/itemManage/DeleteModal.vue
Normal file
53
app/components/itemManage/DeleteModal.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<UModal
|
||||
v-model:open="open"
|
||||
:title="`删除 ${item?.name}?`"
|
||||
:description="`确定吗?此操作不可被还原。`"
|
||||
>
|
||||
<slot />
|
||||
|
||||
<template #body>
|
||||
<div class="flex justify-end gap-2">
|
||||
<UButton
|
||||
label="Cancel"
|
||||
color="neutral"
|
||||
variant="subtle"
|
||||
@click="open = false"
|
||||
/>
|
||||
<UButton
|
||||
label="Delete"
|
||||
color="error"
|
||||
variant="solid"
|
||||
loading-auto
|
||||
@click="onSubmit"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</UModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
item?: Item | null;
|
||||
}>(),
|
||||
{
|
||||
item: null,
|
||||
}
|
||||
);
|
||||
|
||||
const { removeItem } = useItemsStore();
|
||||
|
||||
const open = defineModel<boolean>("open", { default: false });
|
||||
|
||||
async function onSubmit() {
|
||||
// await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
if (!props.item || props.item.id == null) {
|
||||
return;
|
||||
}
|
||||
removeItem(props.item.id);
|
||||
open.value = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
Reference in New Issue
Block a user