fix: update style

This commit is contained in:
Qiuxia Fan 2022-01-13 13:58:01 +08:00
parent 9dc9dd3672
commit 4efbe48664
5 changed files with 22 additions and 24 deletions

View File

@ -37,7 +37,9 @@ limitations under the License. -->
<el-icon class="menu-icons" :style="{ marginRight: '12px' }"> <el-icon class="menu-icons" :style="{ marginRight: '12px' }">
<Icon size="lg" :iconName="menu.meta.icon" /> <Icon size="lg" :iconName="menu.meta.icon" />
</el-icon> </el-icon>
<span>{{ t(menu.meta.title) }}</span> <span :class="isCollapse ? 'collapse' : ''">{{
t(menu.meta.title)
}}</span>
</router-link> </router-link>
</template> </template>
<el-menu-item-group> <el-menu-item-group>
@ -88,24 +90,16 @@ limitations under the License. -->
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import { useRouter, RouteRecordRaw, RouteRecordName } from "vue-router"; import { useRouter, RouteRecordRaw } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import {
ElMenu,
ElMenuItem,
ElSubMenu,
ElMenuItemGroup,
ElIcon,
} from "element-plus";
const { t } = useI18n(); const { t } = useI18n();
const name: RouteRecordName | null | undefined = String( const name = ref<any>(String(useRouter().currentRoute.value.name));
useRouter().currentRoute.value.name const theme = ["VirtualMachine", "Kubernetes"].includes(name.value || "")
);
const theme = ["VirtualMachine", "Kubernetes"].includes(name || "")
? ref("light") ? ref("light")
: ref("black"); : ref("black");
const routes = useRouter().options.routes; const routes = ref<any>(useRouter().options.routes);
const isCollapse = ref(false); const isCollapse = ref(true);
const controlMenu = () => { const controlMenu = () => {
isCollapse.value = !isCollapse.value; isCollapse.value = !isCollapse.value;
}; };
@ -125,7 +119,6 @@ const filterMenus = (menus: any[]) => {
height: 100%; height: 100%;
background: #252a2f; background: #252a2f;
font-weight: bold; font-weight: bold;
// box-shadow: 1px 5px 3px #888;
} }
.el-menu-vertical:not(.el-menu--collapse) { .el-menu-vertical:not(.el-menu--collapse) {
@ -136,6 +129,15 @@ const filterMenus = (menus: any[]) => {
.logo-icon-collapse { .logo-icon-collapse {
width: 65px; width: 65px;
margin: 15px 0 30px 0; margin: 15px 0 30px 0;
text-align: center;
}
span.collapse {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
} }
.logo-icon { .logo-icon {

View File

@ -20,14 +20,14 @@ import router from "./router";
import { store } from "./store"; import { store } from "./store";
import components from "@/components"; import components from "@/components";
import i18n from "./locales"; import i18n from "./locales";
import "element-plus/dist/index.css";
import "./styles/lib.scss"; import "./styles/lib.scss";
import "./styles/reset.scss"; import "./styles/reset.scss";
import ElementPlus from "element-plus"; import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
const app = createApp(App); const app = createApp(App);
app.use(ElementPlus); app.use(ElementPlus, { size: "small", zIndex: 3000 });
app.use(components); app.use(components);
app.use(i18n); app.use(i18n);
app.use(store); app.use(store);

View File

@ -28,7 +28,6 @@ limitations under the License. -->
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ElDialog } from "element-plus";
import GridLayout from "./panel/Layout.vue"; import GridLayout from "./panel/Layout.vue";
// import { LayoutConfig } from "@/types/dashboard"; // import { LayoutConfig } from "@/types/dashboard";
import Tool from "./panel/Tool.vue"; import Tool from "./panel/Tool.vue";

View File

@ -18,7 +18,7 @@
import Area from "./Area.vue"; import Area from "./Area.vue";
import Line from "./Line.vue"; import Line from "./Line.vue";
import Bar from "./Bar.vue"; import Bar from "./Bar.vue";
import Heatmap from "./Heatmap.vue"; import Heatmap from "./HeatMap.vue";
import TopList from "./TopList.vue"; import TopList from "./TopList.vue";
import Table from "./Table.vue"; import Table from "./Table.vue";
import Pie from "./Pie.vue"; import Pie from "./Pie.vue";

View File

@ -22,9 +22,9 @@ limitations under the License. -->
:options="Options" :options="Options"
size="mini" size="mini"
placeholder="Select a service" placeholder="Select a service"
:borderRadius="0"
@change="changeService" @change="changeService"
class="selectors" class="selectors"
:borderRadius="4"
/> />
</div> </div>
<div class="selectors-item" v-if="states.key === 3 || states.key === 4"> <div class="selectors-item" v-if="states.key === 3 || states.key === 4">
@ -141,9 +141,6 @@ function clickIcons(t: { id: string; content: string; name: string }) {
font-size: 12px; font-size: 12px;
display: inline-block; display: inline-block;
padding: 4px 2px; padding: 4px 2px;
border: var(--el-input-border, var(--el-border-base));
border-right: none;
border-radius: 2px;
} }
.icon-btn { .icon-btn {