Skip to content

Commit 9fd7b18

Browse files
committed
初始化
1 parent 5930ff0 commit 9fd7b18

20 files changed

+824
-0
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
["es2015", { "modules": false }]
4+
]
5+
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log

index.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>vue-element</title>
6+
</head>
7+
<style media="screen">
8+
html,body{
9+
font-family: Microsoft Yahei;
10+
height: 100%;
11+
margin: 0;
12+
}
13+
</style>
14+
<body>
15+
<div id="app">
16+
<router-view></router-view>
17+
</div>
18+
<script src="/dist/build.js"></script>
19+
</body>
20+
</html>

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "vue-element",
3+
"description": "A Vue.js project",
4+
"version": "1.0.0",
5+
"author": "monster1935 <[email protected]>",
6+
"private": true,
7+
"scripts": {
8+
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
9+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
10+
},
11+
"dependencies": {
12+
"element-ui": "^1.0.5",
13+
"vue": "^2.1.0",
14+
"vue-router": "^2.1.1"
15+
},
16+
"devDependencies": {
17+
"babel-core": "^6.0.0",
18+
"babel-loader": "^6.0.0",
19+
"babel-preset-es2015": "^6.0.0",
20+
"cross-env": "^3.0.0",
21+
"css-loader": "^0.26.1",
22+
"file-loader": "^0.9.0",
23+
"style-loader": "^0.13.1",
24+
"vue-loader": "^10.0.0",
25+
"vue-template-compiler": "^2.1.0",
26+
"webpack": "^2.1.0-beta.25",
27+
"webpack-dev-server": "^2.1.0-beta.0"
28+
}
29+
}

src/App.vue

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<template>
2+
<div id="app">
3+
<div class="app_header">
4+
<data-header></data-header>
5+
</div>
6+
<div class="app_content">
7+
<div class="app_nav">
8+
<side-nav></side-nav>
9+
</div>
10+
<div class="app_right">
11+
<div class="breadcrumb">
12+
<el-breadcrumb separator="/">
13+
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
14+
<el-breadcrumb-item>{{pathName}}</el-breadcrumb-item>
15+
16+
</el-breadcrumb>
17+
</div>
18+
<router-view></router-view>
19+
</div>
20+
</div>
21+
22+
</div>
23+
</template>
24+
25+
<script>
26+
import DataHeader from './components/common/DataHeader.vue'
27+
import SideNav from './components/common/SideNav.vue'
28+
import Nothing from './components/common/Nothing.vue'
29+
30+
export default {
31+
name: 'app',
32+
data () {
33+
return {
34+
pathName: this.$route.name,
35+
}
36+
},
37+
components:{
38+
DataHeader,
39+
SideNav,
40+
Nothing
41+
},
42+
watch: {
43+
'$route': function(){
44+
this.pathName = this.$route.name;
45+
46+
}
47+
}
48+
}
49+
</script>
50+
51+
<style>
52+
53+
#app{
54+
height: 100%;
55+
margin: 0;
56+
display: flex;
57+
flex-flow: column;
58+
}
59+
.app_header{
60+
position: relative;
61+
flex: 0 0 auto;
62+
z-index: 2;
63+
64+
}
65+
.app_header .title{
66+
margin-left: 20px;
67+
color: #fff;
68+
}
69+
.app_content{
70+
flex: 1;
71+
display: flex;
72+
flex-flow: row;
73+
}
74+
.app_nav{
75+
display: relative;
76+
top: 64px;
77+
flex: 0 0 280px;
78+
background: #EFF2F7;
79+
}
80+
.app_right{
81+
flex: 1;
82+
overflow: auto;
83+
padding: 20px;
84+
85+
}
86+
.breadcrumb{
87+
padding-bottom: 20px;
88+
border-bottom: 1px solid #ddd;
89+
}
90+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/common/DataHeader.vue

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<template>
2+
<div class="header-wraper">
3+
<el-menu theme="dark" default-active="1" class="el-menu-demo" mode="horizontal" @select="handleSelect">
4+
5+
<li class="title">
6+
<i class="el-icon-menu"></i>
7+
<span>后台管理系统</span>
8+
</li>
9+
<li class="option">
10+
<el-select v-model="value" placeholder="请选择">
11+
<el-option v-for="item in options" :label="item.label" :value="item.value">
12+
</el-option>
13+
</el-select>
14+
</li>
15+
<li class="user">
16+
<el-dropdown trigger="click">
17+
<span class="el-dropdown-link">
18+
monster1935<i class="el-icon-caret-bottom el-icon--right"></i>
19+
</span>
20+
<el-dropdown-menu slot="dropdown">
21+
<el-dropdown-item>退出</el-dropdown-item>
22+
</el-dropdown-menu>
23+
</el-dropdown>
24+
</li>
25+
</el-menu>
26+
</div>
27+
</template>
28+
29+
30+
<script>
31+
export default {
32+
data() {
33+
return {
34+
options: [{
35+
label: "test1",
36+
value: 1
37+
}, {
38+
label: "test2",
39+
value: 2
40+
}, {
41+
label: "test3",
42+
value: 3
43+
}, {
44+
label: "test4",
45+
value: 4
46+
}, ],
47+
value: 1
48+
49+
}
50+
},
51+
methods: {
52+
handleSelect(key, keyPath) {
53+
console.log(key, keyPath);
54+
}
55+
}
56+
}
57+
</script>
58+
59+
60+
<style media="screen">
61+
.header-wraper li {
62+
float: left;
63+
margin-right: 20px;
64+
margin-top: 5px;
65+
}
66+
67+
.title {
68+
padding: 1em .2em;
69+
}
70+
71+
.title span {
72+
font-size: 1.4em;
73+
margin-left: 5px;
74+
}
75+
76+
.option {
77+
padding-top: 10px;
78+
}
79+
.user .el-dropdown{
80+
position: absolute;
81+
right: 20px;
82+
padding-top: 20px;
83+
color: #fff !important;
84+
}
85+
</style>

src/components/common/Nothing.vue

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="nothing">
3+
<h1>暂无内容</h1>
4+
</div>
5+
</template>
6+
7+
<style media="screen">
8+
9+
.nothing{
10+
position: relative;
11+
12+
}
13+
.nothing h1{
14+
color: #ccc;
15+
text-align: center;
16+
margin-top: 20%;
17+
}
18+
</style>

src/components/common/SideNav.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
3+
4+
<el-menu default-active="/testManagement" class="el-menu-vertical-demo" router>
5+
6+
<el-menu-item index="/testManagement"><i class="el-icon-menu"></i>测试管理</el-menu-item>
7+
<el-menu-item index="/userGroup"><i class="el-icon-setting"></i>用户分群管理</el-menu-item>
8+
<hr>
9+
<el-menu-item index="help"><i class="el-icon-menu"></i>帮助中心</el-menu-item>
10+
<el-menu-item index="feedback"><i class="el-icon-setting"></i>意见反馈</el-menu-item>
11+
</el-menu>
12+
13+
</template>

src/components/feedback/Feedback.vue

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div id="testManagement">
3+
<nothing></nothing>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import Nothing from '../common/Nothing.vue';
9+
10+
export default{
11+
data(){
12+
return {
13+
14+
}
15+
},
16+
components:{
17+
Nothing
18+
}
19+
}
20+
</script>

src/components/help/Help.vue

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div id="testManagement">
3+
<nothing></nothing>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import Nothing from '../common/Nothing.vue';
9+
10+
export default{
11+
data(){
12+
return {
13+
14+
}
15+
},
16+
components:{
17+
Nothing
18+
}
19+
}
20+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<div id="testManagement">
3+
<el-tabs :active-name="activeName">
4+
<el-tab-pane label="方案测试" name="first">
5+
<test-project></test-project>
6+
</el-tab-pane>
7+
<el-tab-pane label="用户测试" name="second">
8+
<test-user></test-user>
9+
</el-tab-pane>
10+
11+
</el-tabs>
12+
</div>
13+
</template>
14+
15+
<script>
16+
import Nothing from '../common/Nothing.vue';
17+
import TestProject from './TestProject.vue';
18+
import TestUser from './TestUser.vue'
19+
export default{
20+
data(){
21+
return {
22+
activeName: 'first'
23+
}
24+
},
25+
components:{
26+
Nothing,
27+
TestProject,
28+
TestUser
29+
}
30+
}
31+
</script>
32+
33+
<style>
34+
.el-tabs{
35+
width: 100%;
36+
}
37+
</style>

0 commit comments

Comments
 (0)