|
|
@@ -0,0 +1,168 @@
|
|
|
+<template>
|
|
|
+<!-- <div class="common-layout">-->
|
|
|
+ <el-container class="container">
|
|
|
+ <el-header style="background-color: aliceblue;">
|
|
|
+ <div style="font-size: x-large;text-align: start">
|
|
|
+ <span >测试用例生成系统</span>
|
|
|
+ </div>
|
|
|
+ <el-icon size="40" ><Avatar/></el-icon>
|
|
|
+ </el-header>
|
|
|
+ <el-container>
|
|
|
+ <!-- 侧边栏 -->
|
|
|
+ <el-aside :width="isCollapse ? '64px':'200px'">
|
|
|
+ <!-- 侧边栏菜单区域 -->
|
|
|
+ <!-- 侧边栏菜单区域 -->
|
|
|
+ <el-menu
|
|
|
+ default-active="2"
|
|
|
+ class="el-menu-vertical-demo"
|
|
|
+ @open="handleOpen"
|
|
|
+ @close="handleClose"
|
|
|
+ router
|
|
|
+ >
|
|
|
+ <el-menu-item index="upload">
|
|
|
+ <el-icon><Plus /></el-icon>
|
|
|
+ <span style="font-size: large">生成测试用例</span>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-sub-menu index="2">
|
|
|
+ <template #title>
|
|
|
+ <el-icon><Collection /></el-icon>
|
|
|
+ <span style="font-size: large">任务列表</span>
|
|
|
+ </template>
|
|
|
+ <el-menu-item-group title="新建挡板.txt" style="text-align: center">
|
|
|
+ <el-menu-item index="testcaseList">用例列表展示</el-menu-item>
|
|
|
+ <el-menu-item index="tcFinalList">生成完整测试用例</el-menu-item>
|
|
|
+ <el-menu-item index="">知识图谱</el-menu-item>
|
|
|
+ </el-menu-item-group>
|
|
|
+ <el-menu-item-group title="上传图片.txt">
|
|
|
+ <el-menu-item index="1-3">item three</el-menu-item>
|
|
|
+ </el-menu-item-group>
|
|
|
+ <el-sub-menu index="1-4">
|
|
|
+ <template #title>item four</template>
|
|
|
+ <el-menu-item index="1-4-1">item one</el-menu-item>
|
|
|
+ </el-sub-menu>
|
|
|
+ </el-sub-menu>
|
|
|
+
|
|
|
+ <el-menu-item index="4">
|
|
|
+ <el-icon><setting /></el-icon>
|
|
|
+ <span style="font-size: large">不知道放什么</span>
|
|
|
+ </el-menu-item>
|
|
|
+ </el-menu>
|
|
|
+ </el-aside>
|
|
|
+ <!-- 右侧内容主体区域 -->
|
|
|
+ <el-main>
|
|
|
+ <!-- 路由占位符 -->
|
|
|
+ <router-view></router-view>
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+<!-- <el-container>-->
|
|
|
+<!-- <el-aside width="200px" > Aside </el-aside>-->
|
|
|
+<!-- <el-main>Main</el-main>-->
|
|
|
+<!-- </el-container>-->
|
|
|
+ </el-container>
|
|
|
+<!-- </div>-->
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ // 左侧菜单数据对象
|
|
|
+ menulist: [],
|
|
|
+ // 字体图标对象
|
|
|
+ iconsObj: {
|
|
|
+ 125: 'iconfont icon-users',
|
|
|
+ 103: 'iconfont icon-tijikongjian',
|
|
|
+ 101: 'iconfont icon-shangpin',
|
|
|
+ 102: 'iconfont icon-danju',
|
|
|
+ 145: 'iconfont icon-baobiao'
|
|
|
+ },
|
|
|
+ // 是否折叠
|
|
|
+ isCollapse: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getMenuList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ logout () {
|
|
|
+ window.sessionStorage.clear()
|
|
|
+ this.$router.push('/login')
|
|
|
+ },
|
|
|
+ // 获取所有的菜单数据
|
|
|
+ async getMenuList () {
|
|
|
+ const { data: res } = await this.$http.get('menus')
|
|
|
+ if (res.meta.status !== 200) return this.$message.error(res.meta.msg)
|
|
|
+ // 成功了,进行赋值
|
|
|
+ this.menulist = res.data
|
|
|
+ console.log(res)
|
|
|
+ },
|
|
|
+ // 点击按钮,切换菜单的折叠与展开
|
|
|
+ toggleCollapse () {
|
|
|
+ this.isCollapse = !this.isCollapse
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+.common-layout {
|
|
|
+ display: flex;
|
|
|
+ position: relative;
|
|
|
+ margin: 0;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%
|
|
|
+}
|
|
|
+.admin-home {
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+ width: 100%
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.logo {
|
|
|
+ /* 样式 */
|
|
|
+}
|
|
|
+
|
|
|
+.user-info {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.container {
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.el-header{
|
|
|
+ background-color: aliceblue;
|
|
|
+ display: flex;
|
|
|
+ /*// 让它贴标左右对齐*/
|
|
|
+ justify-content: space-between;
|
|
|
+ /*// 清空图片左侧padding*/
|
|
|
+ padding-left: 0;
|
|
|
+ /*// 按钮居中*/
|
|
|
+ align-items: center;
|
|
|
+ /*// 文本颜色*/
|
|
|
+ color: black;
|
|
|
+ /*// 设置文本字体大小*/
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+el-header.div{
|
|
|
+ /*// 弹性布局*/
|
|
|
+ display: flex;
|
|
|
+ /*// 纵向上居中对齐*/
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+el-header.div.span {
|
|
|
+ margin-left: 15px;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|
|
|
+
|