feat(cms):优化导航管理界面功能布局

- 调整按钮布局,将模型管理和清除缓存按钮移至显眼位置
- 添加展开/折叠按钮的图标和状态切换逻辑- 增加备份和恢复功能按钮,仅超级管理员可见- 移除重复的模型管理和清除缓存按钮
- 引入新的图标组件支持展开/折叠操作- 删除未使用的页面组件引用
- 更新开发环境配置,注释本地API地址
This commit is contained in:
2025-10-10 13:26:58 +08:00
parent 0cff3697ad
commit e8cd62f86b
3 changed files with 40 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理(开发环境) VITE_APP_NAME=后台管理(开发环境)
VITE_API_URL=http://127.0.0.1:9200/api #VITE_API_URL=http://127.0.0.1:9200/api
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api #VITE_SERVER_API_URL=http://127.0.0.1:8000/api

View File

@@ -1,7 +1,7 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<template> <template>
<a-space :size="10" style="flex-wrap: wrap"> <a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="openEdit()"> <a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon> <template #icon>
<plus-outlined/> <plus-outlined/>
</template> </template>
@@ -13,6 +13,13 @@
<a-button type="dashed" class="ele-btn-icon" @click="foldAll"> <a-button type="dashed" class="ele-btn-icon" @click="foldAll">
折叠 折叠
</a-button> </a-button>
<a-button type="dashed" @click="openUrl('/website/model')"
>模型管理
</a-button
>
<a-button type="dashed" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-radio-group v-model:value="position" @change="reload"> <a-radio-group v-model:value="position" @change="reload">
<a-radio-button :value="1">顶部</a-radio-button> <a-radio-button :value="1">顶部</a-radio-button>
@@ -41,15 +48,6 @@
@search="reload" @search="reload"
@pressEnter="reload" @pressEnter="reload"
/> />
<a-button
type="text"
@click="openUrl('/website/model')"
>模型管理
</a-button
>
<a-button type="text" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button>
</a-space> </a-space>
</template> </template>

View File

@@ -22,17 +22,39 @@
> >
<template #toolbar> <template #toolbar>
<a-space> <a-space>
<a-button type="primary" class="ele-btn-icon" @click="openEdit()"> <a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon> <template #icon>
<plus-outlined/> <PlusOutlined/>
</template> </template>
<span>新建</span> <span>新建</span>
</a-button> </a-button>
<a-button type="dashed" class="ele-btn-icon" @click="expandAll"> <template v-if="expandedRowKeys.length == 0">
展开 <a-button type="dashed" class="ele-btn-icon" @click="expandAll">
</a-button> <template #icon>
<a-button type="dashed" class="ele-btn-icon" @click="foldAll"> <PlusSquareOutlined />
折叠 </template>
展开
</a-button>
</template>
<template v-else>
<a-button type="dashed" class="ele-btn-icon" @click="foldAll">
<template #icon>
<MinusSquareOutlined />
</template>
折叠
</a-button>
</template>
<a-divider type="vertical"/>
<a-button type="dashed" :disabled="!hasRole('superAdmin')" @click="handleExport">备份</a-button>
<a-button type="dashed" :disabled="!hasRole('superAdmin')" @click="openImport">恢复</a-button>
<a-button
type="dashed"
@click="push('/website/model')"
>模型管理
</a-button
>
<a-button type="dashed" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button> </a-button>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-radio-group v-model:value="position" @change="reload"> <a-radio-group v-model:value="position" @change="reload">
@@ -40,7 +62,6 @@
<a-radio-button :value="2">底部</a-radio-button> <a-radio-button :value="2">底部</a-radio-button>
<a-radio-button :value="0">不限</a-radio-button> <a-radio-button :value="0">不限</a-radio-button>
</a-radio-group> </a-radio-group>
<a-divider type="vertical"/>
<a-select <a-select
v-model:value="modelName" v-model:value="modelName"
style="width: 150px" style="width: 150px"
@@ -60,15 +81,6 @@
@search="reload" @search="reload"
@pressEnter="reload" @pressEnter="reload"
/> />
<a-button
type="text"
@click="push('/website/model')"
>模型管理
</a-button
>
<a-button type="text" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button>
</a-space> </a-space>
</template> </template>
<template #bodyCell="{ column, record, index }"> <template #bodyCell="{ column, record, index }">
@@ -218,7 +230,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import {ref} from 'vue'; import {ref} from 'vue';
import {message} from 'ant-design-vue/es'; import {message} from 'ant-design-vue/es';
import {PlusOutlined, CopyOutlined, FileWordOutlined} from '@ant-design/icons-vue'; import {PlusOutlined, CopyOutlined, FileWordOutlined, MinusOutlined, MinusSquareOutlined, PlusSquareOutlined} from '@ant-design/icons-vue';
import type { import type {
DatasourceFunction, DatasourceFunction,
ColumnItem, ColumnItem,
@@ -250,6 +262,7 @@ import Extra from "./components/extra.vue";
import {useRouter} from 'vue-router'; import {useRouter} from 'vue-router';
import {listCmsModel} from "@/api/cms/cmsModel"; import {listCmsModel} from "@/api/cms/cmsModel";
import {CmsModel} from "@/api/cms/cmsModel/model"; import {CmsModel} from "@/api/cms/cmsModel/model";
import {hasRole} from "@/utils/permission";
const {push} = useRouter(); const {push} = useRouter();
// 表格实例 // 表格实例
@@ -358,8 +371,6 @@ const design = ref<CmsDesign>();
const showEdit = ref(false); const showEdit = ref(false);
// 编辑内容 // 编辑内容
const showDesignEdit = ref(false); const showDesignEdit = ref(false);
// 页面组件
const showDesignRecordEdit = ref(false);
// 上级分类id // 上级分类id
const parentId = ref<number>(); const parentId = ref<number>();
const categoryId = ref<number>(); const categoryId = ref<number>();