优化后台界面与无操作退出体验
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<aside class="panel unified-shell faq-category-panel">
|
||||
<div class="header">
|
||||
<span>{{ TEXT.common.labels.category }}</span>
|
||||
<div v-if="canCreateCategory">
|
||||
<div v-if="canManageCategories">
|
||||
<el-button type="primary" size="small" class="category-create-btn" @click="openManager()">编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -21,7 +21,15 @@
|
||||
<span class="cat-count">{{ categoryCounts[c.id] || 0 }}</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<FaqCategoryManager v-model="showForm" :categories="props.categories" :faqs="props.faqs" @success="emit('refresh')" />
|
||||
<FaqCategoryManager
|
||||
v-model="showForm"
|
||||
:categories="props.categories"
|
||||
:faqs="props.faqs"
|
||||
:can-create="canCreateCategory"
|
||||
:can-update="canUpdateCategory"
|
||||
:can-delete="canDeleteCategory"
|
||||
@success="emit('refresh')"
|
||||
/>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
@@ -44,6 +52,9 @@ const showForm = ref(false);
|
||||
|
||||
const { can } = usePermission();
|
||||
const canCreateCategory = computed(() => can("faq.category.create"));
|
||||
const canUpdateCategory = computed(() => can("faq.category.update"));
|
||||
const canDeleteCategory = computed(() => can("faq.category.delete"));
|
||||
const canManageCategories = computed(() => canCreateCategory.value || canUpdateCategory.value || canDeleteCategory.value);
|
||||
const sortedCategories = computed(() =>
|
||||
[...props.categories].sort((a, b) => (a.sort_order ?? 0) - (b.sort_order ?? 0))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user