Browse Source

首页样式调整

old
wangqing 5 years ago
parent
commit
1cc515f490
  1. 2
      README.md
  2. 29
      src/utils/index.js
  3. 28
      src/views/home/index.vue
  4. 18
      src/views/official/index.vue
  5. 14
      src/views/official/introduction.vue

2
README.md

@ -56,7 +56,7 @@ https://www.ydyno.com/archives/1219.html
- 感谢 (https://gitee.com/eoner/vue-automation) 前端脚手架
- 感谢 (https://gitee.com/TDuckApp/form-generator) 表单生成器
- 感谢 (https://gitee.com/mrhj/form-generator) 表单生成器

29
src/utils/index.js

@ -241,3 +241,32 @@ export function timeFormat(ms)
function addZero(n) {
return n < 10 ? '0' + n : n
}
/**
* 判断是否是Url
* @param str
* @returns {boolean}
*/
export function checkIsUrl(str) {
let oRegUrl = new RegExp()
//aa.bb.com
oRegUrl.compile('^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$')
if (!oRegUrl.test(str)) {
return false
}
return true
}
/**
* 打开
* @param url
*/
export function openUrl(url) {
var a = document.createElement('a')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
a.setAttribute('id', 'd2admin-link-temp')
document.body.appendChild(a)
a.click()
document.body.removeChild(document.getElementById('d2admin-link-temp'))
}

28
src/views/home/index.vue

@ -9,11 +9,15 @@
>
</el-col>
<el-col :span="10">
<el-menu :default-active="menuIndex" mode="horizontal" :router="true" text-color="#205BB5"
<el-menu :default-active="menuIndex" mode="horizontal"
text-color="#205BB5"
active-text-color="#205BB5"
@select="activeMenuHandle"
>
<el-menu-item v-for="(item, index) in menuRouters" :key="index" :index="item.routerPath"
:route="item.routerPath" class="menu-item"
<el-menu-item v-for="(item, index) in menuRouters"
:key="index"
:index="item.routerPath"
class="menu-item"
>
{{ item.title }}
</el-menu-item>
@ -81,6 +85,7 @@
import store from '@/store/index.js'
import FontIcon from '@/components/FontIcon'
import router from '@/router'
import {openUrl, checkIsUrl} from '@/utils/index'
export default {
name: 'Home',
@ -90,15 +95,15 @@ export default {
menuIndex: null,
menuRouters: [
{
routerPath: '/proposal',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform?time=1',
title: '免费模板'
},
{
routerPath: '/sources',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform',
title: '开源项目'
},
{
routerPath: '/enterprise',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform/issues',
title: '提出建议'
}
]
@ -113,17 +118,16 @@ export default {
return user
}
},
watch: {
$route(to) {
this.menuIndex = to.path
}
},
mounted() {
this.menuIndex = this.$route.path
},
methods: {
activeMenuHandle(routerPath) {
this.menuIndex = routerPath
if (checkIsUrl(routerPath)) {
openUrl(routerPath)
} else {
this.menuIndex = routerPath
}
},
logoutHandle() {
this.$confirm('您确定要退出登录吗?', '退出确认', {

18
src/views/official/index.vue

@ -12,8 +12,9 @@
<el-col class="header-col" :span="12" :offset="2">
<el-menu :default-active="menuIndex" mode="horizontal"
style="width: 100%;"
:router="true" text-color="#205BB5"
text-color="#205BB5"
active-text-color="#205BB5"
@select="activeMenuHandle"
>
<el-menu-item v-for="(item, index) in menuRouters" :key="index" :index="item.routerPath"
:route="item.routerPath" class="menu-item"
@ -39,6 +40,7 @@
</template>
<script>
import store from '@/store/index.js'
import {checkIsUrl, openUrl} from '@/utils'
export default {
name: 'Official',
@ -51,15 +53,15 @@ export default {
title: '首页'
},
{
routerPath: '/proposal',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform/issues',
title: '提出建议'
},
{
routerPath: '/sources',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform?time=2',
title: '开源版本'
},
{
routerPath: '/enterprise',
routerPath: 'https://gitee.com/TDuckApp/tduck-platform?time=1',
title: '企业部署'
}
@ -81,6 +83,14 @@ export default {
},
mounted() {
this.menuIndex = this.$route.path
}, methods: {
activeMenuHandle(routerPath) {
if (checkIsUrl(routerPath)) {
openUrl(routerPath)
} else {
this.menuIndex = routerPath
}
}
}
}
</script>

14
src/views/official/introduction.vue

@ -80,7 +80,6 @@
<img style="height: 478px;"
src="@/assets/images/official/v2_q2wxu6.gif"
>
>
</div>
</div>
<div class="introduction-footer">
@ -132,9 +131,11 @@
</el-col>
</el-row>
<el-divider />
<p class="subtitle" style="text-align: center;">
Copyright © 2020 TDuckCloud. All Rights Reserved. 湘ICP备19005498号-1 湖南省众达数蔚信息技术有限公司 版权所有
</p>
<div class="copyright">
<p class="subtitle" style="text-align: center;">
Copyright © 2020 TDuckCloud. All Rights Reserved. 湘ICP备19005498号-1 湖南省众达数蔚信息技术有限公司 版权所有
</p>
</div>
</div>
</div>
</div>
@ -237,7 +238,7 @@ export default {
border: 1px solid rgba(255, 255, 255, 100);
}
.introduction-footer {
height: 350px;
height: 370px;
line-height: 20px;
background-color: rgba(32, 91, 181, 100);
text-align: center;
@ -254,4 +255,7 @@ export default {
font-size: 14px;
text-align: left;
}
.copyright {
height: 35px;
}
</style>

Loading…
Cancel
Save