|
@@ -0,0 +1,78 @@
|
|
|
+<template>
|
|
|
+ <div class="menu">
|
|
|
+ <ul class="menu-list">
|
|
|
+ <li
|
|
|
+ v-for="{ key, name } in subMenuList"
|
|
|
+ :key="key"
|
|
|
+ :class="['menu-item', { active: key === activeKey }]"
|
|
|
+ @click="changeSubMenu(key)"
|
|
|
+ >
|
|
|
+ {{ name }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'ConfigMenuPage',
|
|
|
+ props: {
|
|
|
+ curKey: {
|
|
|
+ type: String,
|
|
|
+ default: 'mail',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeKey: this.curKey,
|
|
|
+ // 子菜单列表
|
|
|
+ subMenuList: [{ key: 'mail', name: '邮箱配置' }],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * 切换子菜单
|
|
|
+ * @param {number} key - 子菜单键
|
|
|
+ */
|
|
|
+ changeSubMenu(key) {
|
|
|
+ if (key === this.activeKey) return;
|
|
|
+ this.activeKey = key;
|
|
|
+ this.$router.push({ path: `/system_config/${key}` });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.menu {
|
|
|
+ z-index: 9;
|
|
|
+ display: flex;
|
|
|
+ background-color: $main-background-color;
|
|
|
+
|
|
|
+ &-list {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ border-radius: 8px;
|
|
|
+
|
|
|
+ .menu-item {
|
|
|
+ padding: 10px 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ background-color: #ebebeb;
|
|
|
+ border: $border;
|
|
|
+ border-radius: 4px;
|
|
|
+ transition: background-color 0.3s ease;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #e0e0e0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ font-weight: bold;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0 2px 4px #e6e6e6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|