Browse Source

创建并调整项目顶级父页面结构

old
VinceJins 6 years ago
parent
commit
861b064271
  1. BIN
      public/favicon.ico
  2. 11
      public/index.html
  3. 24
      src/App.vue
  4. 32
      src/layout/design-header.vue
  5. 29
      src/layout/design-layout.vue
  6. 44
      src/layout/example.vue
  7. 2
      src/router/index.js
  8. 22
      src/router/modules/design.js
  9. 4
      src/router/modules/root.js
  10. 107
      src/views/Home.vue
  11. 15
      src/views/account/login.vue
  12. 30
      src/views/design/index.vue
  13. 216
      src/views/design/login.vue
  14. 15
      src/views/design/test1.vue
  15. 15
      src/views/design/test2.vue

BIN
public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 44 KiB

11
public/index.html

@ -5,12 +5,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Tduck-Cloud</title> <title>TDuck Cloud</title>
<style>
body {
background-image: linear-gradient(to right, #706ee6 , #b98edc, #e3eefd);
margin: 0px;
}
</style>
</head> </head>
<body> <body>
<noscript>
<strong>We're sorry but vue-automation doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>

24
src/App.vue

@ -6,6 +6,7 @@
<script> <script>
export default { export default {
name: 'App',
provide() { provide() {
return { return {
reload: this.reload reload: this.reload
@ -16,26 +17,11 @@ export default {
isRouterAlive: true isRouterAlive: true
} }
}, },
watch: {
$route: 'routeChange'
},
methods: { methods: {
reload() { // reload() {
this.isRouterAlive = false // this.isRouterAlive = false;
this.$nextTick(() => (this.isRouterAlive = true)) // this.$nextTick(() => (this.isRouterAlive = true));
}, // }
routeChange(newVal, oldVal) {
if (newVal.name == oldVal.name) {
this.reload()
}
}
},
metaInfo: {
titleTemplate: title => {
return title
? `${title} - ${process.env.VUE_APP_TITLE}`
: process.env.VUE_APP_TITLE
}
} }
} }
</script> </script>

32
src/layout/design-header.vue

@ -1,32 +0,0 @@
<template>
<el-menu :default-active="1" class="el-menu-demo" mode="horizontal" >
<el-menu-item index="1">
<RouterLink to="/design/test1">演示Demo</RouterLink>
</el-menu-item>
<el-submenu index="2">
<template slot="title">我的工作台</template>
<el-menu-item index="2-1">选项1</el-menu-item>
<el-menu-item index="2-2">选项2</el-menu-item>
<el-menu-item index="2-3">选项3</el-menu-item>
<el-submenu index="2-4">
<template slot="title">选项4</template>
<el-menu-item index="2-4-1">选项1</el-menu-item>
<el-menu-item index="2-4-2">选项2</el-menu-item>
<el-menu-item index="2-4-3">选项3</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item index="3" disabled>消息中心</el-menu-item>
<el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
</el-menu>
</template>
<script>
export default {
name: 'DesignHeader'
}
</script>
<style scoped>
</style>

29
src/layout/design-layout.vue

@ -1,29 +0,0 @@
<template>
<el-container>
<el-header>
<design-header/>
</el-header>
<el-main>
<router-view/>
</el-main>
<el-footer>Footer</el-footer>
</el-container>
</template>
<script>
import DesignHeader from './design-header'
export default {
name: 'DesignLayout',
data() {
return {}
},
components: {
DesignHeader
},
methods: {}
}
</script>
<style scoped>
</style>

44
src/layout/example.vue

@ -1,44 +0,0 @@
<template>
<div>
<div id="nav">
<RouterLink to="/example/sprite">sprite精灵图</RouterLink>
<RouterLink to="/example/svgicon">svg icon</RouterLink>
<RouterLink to="/example/globalComponent">全局组件</RouterLink>
<RouterLink to="/example/axios">axios</RouterLink>
<RouterLink to="/example/cookie">cookie</RouterLink>
<RouterLink to="/example/meta">meta</RouterLink>
<RouterLink to="/example/vuex">vuex</RouterLink>
<RouterLink to="/example/component">组件</RouterLink>
<RouterLink :to="{name:'exampleParams',params:{test:'123'}}">路由params</RouterLink>
<RouterLink :to="{path:'/example/query',query:{test:'123'}}">路由query</RouterLink>
<RouterLink to="/example/reload">刷新当前页面</RouterLink>
<RouterLink to="/example/permission/router">router鉴权</RouterLink>
<RouterLink to="/example/permission/js">js鉴权</RouterLink>
<RouterLink to="/example/user">基本操作</RouterLink>
</div>
<RouterView />
</div>
</template>
<style lang="scss" scoped>
#nav {
margin-bottom: 10px;
a {
text-decoration: none;
font-size: 14px;
&::after {
content: '|';
margin: 0 10px;
font-weight: normal;
font-size: 14px;
}
&:last-child::after {
content: none;
}
&.router-link-active {
font-weight: bold;
font-size: 18px;
}
}
}
</style>

2
src/router/index.js

@ -1,3 +1,5 @@
/* eslint-disable camelcase */
/* eslint-disable no-undef */
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import store from '@/store/index' import store from '@/store/index'

22
src/router/modules/design.js

@ -1,22 +0,0 @@
import DesignLayout from '@/layout/design-layout'
export default {
path: '/design',
meta: {
requireLogin: true
},
redirect: '/design/test1',
component: DesignLayout,
children: [
{
path: 'test1',
component: () =>
import(/* webpackChunkName: 'example' */ '@/views/design/test1.vue')
},
{
path: 'test2',
component: () =>
import(/* webpackChunkName: 'example' */ '@/views/design/test2.vue')
}
]
}

4
src/router/modules/root.js

@ -2,9 +2,9 @@ export default [
{ {
path: '/', path: '/',
meta: { meta: {
requireLogin: true requireLogin: false
}, },
component: () => import(/* webpackChunkName: 'root' */ '@/layout/design-layout.vue') component: () => import(/* webpackChunkName: 'root' */ '@/views/Home.vue')
}, },
{ {
path: '/login', path: '/login',

107
src/views/Home.vue

@ -0,0 +1,107 @@
<template>
<div id="home">
<div class="headerDiv">
<el-row>
<el-col class="headerCol" :span="3"></el-col>
<el-col class="headerCol" :span="18">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect()" text-color="#767677" active-text-color="#1d499e">
<div class="headerLogoDiv">
<img src="favicon.ico" class="headerLogo"/>
<span class="headerLogoTitle">TDUCK CLOUD</span>
</div>
<el-menu-item index="enterprise" class="menuItem">企业部署</el-menu-item>
<el-menu-item index="source" class="menuItem">开源版本</el-menu-item>
<el-menu-item index="proposal" class="menuItem">提出建议</el-menu-item>
<el-button class="consoleBtn"> </el-button>
</el-menu>
</el-col>
<el-col class="headerCol" :span="3"></el-col>
</el-row>
</div>
<div class="headerBody">
<div class="indexBody">
<router-view></router-view>
</div>
<div class="footerDiv">
关于我们
</div>
</div>
</div>
</template>
<script>
import store from '@/store/index.js'
export default {
computed: {
getStore() {
return store;
}
},
data() {
return {
activeIndex: null
}
},
methods: {
handleSelect(key, keyPath) {
console.log(key, keyPath);
}
},
mounted() {
console.info(this.getStore);
}
}
</script>
<style scoped>
.headerCol {
border: solid thin white;
}
.headerDiv {
background-color: white;
position: fixed;
width: 100%;
top: 0px;
}
.headerLogo {
float: left;
}
.headerLogoTitle {
float: left;
color: #1d499e;
font-size: 25px;
line-height: 110px;
padding: 0px 15px 0px 15px;
}
.headerLogo {
height: 60px;
padding: 25px 0px 20px 0px;
}
.menuItem {
line-height: 110px;
height: 110px;
font-size: 18px;
}
.consoleBtn {
font-size: 16px;
width: 130px;
margin: 35px 0px 35px 0px;
float: right;
color: #767677;
}
.consoleBtn:focus, .consoleBtn:hover {
border-color: #1d499e;
}
.headerBody {
padding-top: 113px;
}
.footerDiv {
border: solid thin black;
font-size: 14px;
color: white;
text-align: center;
line-height: 110px;
}
.indexBody {
background-color: white;
margin: 50px 0px 0px 0px;
}
</style>

15
src/views/account/login.vue

@ -0,0 +1,15 @@
<template>
<div id="login">
</div>
</template>
<script>
export default {
name: 'login',
data() {
return {
}
}
}
</script>

30
src/views/design/index.vue

@ -1,30 +0,0 @@
<template>
<el-container>
<el-header>
<design-header/>
</el-header>
<el-main>
<router-view></router-view>
</el-main>
<el-footer>Footer</el-footer>
</el-container>
<!-- <RouterLink to="/example">演示Demo</RouterLink>-->
</template>
<script>
import DesignHeader from '../../layout/design-header'
export default {
name: 'index',
data() {
return {}
},
components: {
DesignHeader
},
methods: {}
}
</script>
<style scoped>
</style>

216
src/views/design/login.vue

@ -1,216 +0,0 @@
<template>
<div>
<el-container>
<el-header style="height: 88px;" class="login-header">
<el-row type="flex" align='middle' :gutter="24" style="height: 100%; line-height: 20px;">
<el-col :span="2" :offset="2">
<img class='logo' src="http://q2fgufcw6.bkt.clouddn.com/logo"/>
</el-col>
<el-col :span="3">
<div style="display: flex; justify-content: center; align-items: center;">
<p class="logo-text">TDUCK</p>
<p class="logo-text-sub">填鸭表单</p>
</div>
</el-col>
<el-col :span="1.5">
<router-link class="fun-nav" to="/"> 企业部署</router-link>
</el-col>
<el-col :span="1.5">
<router-link class="fun-nav" to="/2"> 开源版本</router-link>
</el-col>
<el-col :span="1.5">
<router-link class="fun-nav" to="/2"> 提出建议</router-link>
</el-col>
<el-col :span="11">
</el-col>
</el-row>
</el-header>
<el-main class="login-main">
<div class="content">
<div class="banner">
<img
style="width: 489px; height: 477px"
src="http://q2fgufcw6.bkt.clouddn.com/login-banner"/>
</div>
<div class="login-form">
<el-tabs style="width: 300px;" v-model="loginType" @tab-click="loginTypeHandleClick">
<el-tab-pane label="微信扫码登录" name="wx">
<div class="wx-login">
<img class="qrcode" :src="wxLoginQrCode"/>
<el-link icon="el-icon-refresh-left" :underline="false">刷新二维码</el-link>
<el-divider></el-divider>
</div>
</el-tab-pane>
<el-tab-pane label="账号密码登录" name="account">
<el-form ref="form" :model="account" label-width="80px">
<el-form-item label="账号名称">
<el-input v-model="account.username"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input show-password v-model="account.password"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" >登录</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
<div style="display: flex;flex-direction: row;">
<el-link style="margin-left: 20px">忘记密码</el-link>
<el-link style="margin-left: 20px">立即注册</el-link>
<div class="other-login">
<svg-icon class-name="other-login-icon" icon-class="loginQQ"/>
<svg-icon class-name="other-login-icon" icon-class="loginWx"/>
</div>
</div>
<el-divider style="width: 100px"></el-divider>
<p class="login-tip">
关于TDuckCloud登录
若微信扫码失败请打开 微信授权页面 登录
若QQ登录填鸭云异常可查阅 帮助文档
若因微信QQ公众号冻结或账号密码找回失败等无法登录 自助申请 登录账号
</p>
</el-tabs>
</div>
</div>
<div class="footer">
<el-link icon="el-icon-user" style="color: #FFFFFF">关于我们</el-link>
</div>
</el-main>
</el-container>
</div>
</template>
<script>
export default {
name: 'designLogin',
data() {
return {
loginType: 'wx',
account: {
username: '',
password: ''
},
wxLoginQrCode: 'http://q2fgufcw6.bkt.clouddn.com/20191213/9f217b754ad44f0caaa83040ce62fe93.png'
}
},
methods: {
loginTypeHandleClick() {
},
login() {
this.$store.dispatch('token/login').then(() => {
//
if (this.$route.query.redirect) {
this.$router.replace({
path: this.$route.query.redirect
})
} else {
if (window.history.length <= 1) {
this.$router.push({path: '/'})
} else {
this.$router.go(-1)
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.logo {
left: 148px;
top: 20px;
width: 88px;
height: 88px;
border-radius: 100px;
}
.logo-text {
color: rgba(96, 96, 96, 1);
font-size: 20px;
}
.login-header {
line-height: 20px;
background-color: rgba(255, 255, 255, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0);
}
.logo-text-sub {
margin-left: 5px;
color: rgba(96, 96, 96, 1);
font-size: 16px;
}
.fun-nav {
color: rgba(96, 95, 95, 1);
font-size: 18px;
text-align: left;
text-decoration: none;
}
.login-main {
height: 60%;
padding: 0px;
background: url("~@/assets/images/loginView.jpg");
.content {
margin-top: 40px;
width: 100%;
height: 730px;
background-color: #FFFFFF;
display: flex;
align-content: center;
align-items: center;
justify-content: center;
.banner {
}
}
}
.login-form {
margin-left: 100px;
height: 400px;
width: 520px;
.wx-login {
display: flex;
align-content: center;
align-items: center;
justify-content: center;
flex-direction: column;
.qrcode {
margin: 20px;
}
}
.other-login {
margin-left: auto;
.other-login-icon {
margin-left: 10px;
}
}
.login-tip {
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: left;
}
}
.footer {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

15
src/views/design/test1.vue

@ -1,15 +0,0 @@
<template>
<div>
test1
</div>
</template>
<script>
export default {
name: 'test1'
}
</script>
<style scoped>
</style>

15
src/views/design/test2.vue

@ -1,15 +0,0 @@
<template>
<div>
test2
</div>
</template>
<script>
export default {
name: 'test2'
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save