Commit 5da647b6 by 胡悦

提交初始布局

1 parent f850e0a3
<!-- <!--
* @Description: * @Description: 内容
* @Author: huyue * @Author: huyue
* @Date: 2023-07-04 16:12:38 * @Date: 2023-07-04 16:12:38
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-04 16:12:44 * @LastEditTime: 2023-07-05 10:40:02
--> -->
<template> <template>
<div class="ViewContainer"> <div class="ViewContainer">
<div class="ViewContainer-title"> <div class="ViewContainer-title">
<slot name="title" /> <slot name="title" />
</div> </div>
<div class="title-line"></div>
<div class="ViewContainer-body"> <div class="ViewContainer-body">
<slot name="content" /> <slot name="content" />
</div> </div>
...@@ -21,28 +22,34 @@ export default { ...@@ -21,28 +22,34 @@ export default {
name: 'ViewContainer', name: 'ViewContainer',
props: { props: {
}, },
data () { data() {
return { return {
} }
}, },
mounted () { }, mounted() { },
methods: {} methods: {}
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.ViewContainer { .ViewContainer {
width: 100vw; // width: 100vw;
height: 100vh; // height: 100vh;
&-title { &-title {
height: 6.1vh; height: 6.1vh;
width:100%; width:100%;
background-image: url('../assets/images/bg-title.jpg'); background-image: linear-gradient(90deg, #0A214A 0%, #061422 50%, #0A214A 100%);
background-repeat: no-repeat; // background-image: url('../assets/images/bg-title.jpg');
background-size:cover; // background-repeat: no-repeat;
// background-size:cover;
} }
&-body { &-body {
height: 93.9vh; height: calc(93.9vh - 2px);
}
.title-line {
width: 100%;
height: 2px;
background-image: linear-gradient(90deg, #27B0FF 0%, #4792ff00 34%, #5784ff00 66%, #6379FF 100%);
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<div class="view-date">统计年份:业务开始时间:2022年6月30日</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ViewDate'
}
</script>
<style scoped lang='scss'>
.view-date {
display: flex;
align-items: center;
// width: 100%;
height: 6.67vh;
color: #C9C9C9;
padding: 0 1.33vh;
background-color: #091C40;
margin-top: 1.78vh;
}
</style>
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-04 17:21:08 * @LastEditTime: 2023-07-05 10:57:40
* @FilePath: \dj-data-view\src\components\ViewTitle.vue * @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<div class="content flex"> <div class="content flex">
<div class="logo user-select"> <div class="logo user-select">
<img style="height: 3.17vh" src="@/assets/images/logo.png" alt="logo" /> <img style="height: 2.89vh" src="@/assets/images/logo.png" alt="logo" />
</div> </div>
<div class="view-title user-select">嘀加智慧门店运营看板</div> <div>
<div>业务数据</div>
</div>
<!-- <div class="view-title user-select">嘀加智慧门店运营看板</div> -->
<div class="time"> <div class="time">
<div class="top flex"> <div class="top flex">
<div class="now">{{ now }}</div> <div class="now">{{ now }}</div>
...@@ -46,7 +49,7 @@ export default { ...@@ -46,7 +49,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 0 42px 0 76px; padding: 0 26px 0 24px;
justify-content: space-between; justify-content: space-between;
.view-title { .view-title {
font-weight: 600; font-weight: 600;
...@@ -57,7 +60,7 @@ export default { ...@@ -57,7 +60,7 @@ export default {
} }
.time { .time {
text-align: right; text-align: right;
font-size: 14px; font-size: 16px;
color: #ffffff; color: #ffffff;
.top { .top {
justify-content: flex-end; justify-content: flex-end;
......
...@@ -11,7 +11,7 @@ import Router from 'vue-router' ...@@ -11,7 +11,7 @@ import Router from 'vue-router'
import routes from './routes' import routes from './routes'
// hack router push callback // hack router push callback
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) { Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch(err => err)
} }
...@@ -20,11 +20,11 @@ Vue.use(Router) ...@@ -20,11 +20,11 @@ Vue.use(Router)
const router = createRouter() const router = createRouter()
function createRouter () { function createRouter() {
return new Router({ return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath // mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL, base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) { scrollBehavior: function(to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 } return savedPosition || { x: 0, y: 0 }
}, },
routes routes
...@@ -35,9 +35,9 @@ router.beforeEach((to, from, next) => { ...@@ -35,9 +35,9 @@ router.beforeEach((to, from, next) => {
next() next()
}) })
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () { export function resetRouter() {
const newRouter = createRouter() const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router router.matcher = newRouter.matcher // reset router
} }
export default router
\ No newline at end of file \ No newline at end of file
export default router
...@@ -6,19 +6,25 @@ const pages = [ ...@@ -6,19 +6,25 @@ const pages = [
keepAlive: true, keepAlive: true,
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
}, },
children: [ children: []
},
] {
name: 'boutique',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
}
} }
] ]
const keepAlives = [] const keepAlives = []
const setChildren = (e, parent) => { const setChildren = (e, parent) => {
let arr = [] const arr = []
e.children.map(child => { e.children.map(child => {
const { children, meta } = child const { children, meta } = child
let url = `${parent}/${child.name}` const url = `${parent}/${child.name}`
let name = url.replace(/\//g, '.') const name = url.replace(/\//g, '.')
let route = { const route = {
path: `/${url}`, path: `/${url}`,
name, name,
meta: meta || {}, meta: meta || {},
...@@ -31,15 +37,15 @@ const setChildren = (e, parent) => { ...@@ -31,15 +37,15 @@ const setChildren = (e, parent) => {
return arr return arr
} }
const getPages = _ => { const getPages = _ => {
let router = { const router = {
path: '/', path: '/',
name: 'home', name: 'home',
redirect: '/home', redirect: '/home',
component: resolve => require([`views/home.vue`], resolve) component: resolve => require([`views/home.vue`], resolve)
} }
router.children = pages.map(e => { router.children = pages.map(e => {
let name = `${e.name}` const name = `${e.name}`
let route = { const route = {
path: `/${name}`, path: `/${name}`,
name, name,
meta: e.meta || {}, meta: e.meta || {},
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:26:49
-->
<template>
<div class="layout">
<view-container>
<template #title>
<view-title>
</view-title>
</template>
<template #content>
<Charts></Charts>
</template>
</view-container>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-04 11:49:12 * @Date: 2023-07-04 11:49:12
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-04 11:49:15 * @LastEditTime: 2023-07-05 10:05:05
--> -->
<!-- home --> <!-- home -->
<template> <template>
...@@ -32,6 +32,6 @@ export default { ...@@ -32,6 +32,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.data-view-container{ .data-view-container{
background: #090E2B; background: #061422;
} }
</style> </style>
<!--
* @Description: 1.0 左侧
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:50:54
-->
<template>
<div class="left">左侧内容</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ContentLeft'
}
</script>
<style scoped lang='scss'>
.left {
display: flex;
flex-direction: column;
width: 64.17vw;
overflow: hidden;
background: #091C40;
}
</style>
<!--
* @Description: 1.0 右侧内容
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:50:16
-->
<template>
<div class="right">右侧内容</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ContentLeft'
}
</script>
<style scoped lang='scss'>
.right {
display: flex;
flex-direction: column;
width: 31.39vw;
overflow: hidden;
background: #091C40;
}
</style>
<!-- <!--
* @Description: * @Description: 内容
* @Author: huyue * @Author: huyue
* @Date: 2023-07-04 13:56:33 * @Date: 2023-07-04 13:56:33
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-04 17:24:02 * @LastEditTime: 2023-07-05 10:47:13
--> -->
<template> <template>
<div class="content"> <div class="view-content">
<Charts></Charts> <ViewDate></ViewDate>
<!-- <view-content-left /> <div class="content">
<view-content-right /> --> <ContentLeft></ContentLeft>
<ContentRight></ContentRight>
</div>
</div> </div>
</template> </template>
<script> <script>
import ContentLeft from './ContentLeft.vue'
import ContentRight from './ContentRight.vue'
export default { export default {
name: 'ViewContent', name: 'ViewContent',
components: {
ContentLeft,
ContentRight
},
props: { props: {
}, },
data() { data() {
...@@ -26,17 +34,20 @@ export default { ...@@ -26,17 +34,20 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.content { .view-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
padding: 1.46vh 24px 1.95vh; padding: 1.78vh 24px;
gap: 0 16px; gap: 0 16px;
}
.content {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 1.78vh 0;
> div { > div {
height: 100%; // height: 100%;
} }
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-04 13:55:35 * @Date: 2023-07-04 13:55:35
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-04 13:55:41 * @LastEditTime: 2023-07-05 10:41:52
--> -->
<template> <template>
<div class="layout"> <div class="layout">
...@@ -20,12 +20,16 @@ ...@@ -20,12 +20,16 @@
</template> </template>
<script> <script>
import ViewContent from './components/ViewContent.vue'
export default { export default {
name: '', name: '',
data () { components: {
ViewContent
},
data() {
return {} return {}
}, },
mounted () { }, mounted() { },
methods: { methods: {
} }
} }
......
...@@ -10,7 +10,7 @@ const name = defaultSettings.title || 'vue mobile template' ...@@ -10,7 +10,7 @@ const name = defaultSettings.title || 'vue mobile template'
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
module.exports = { module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work/', // 署应用包时的基本 URL。 vue-router hash 模式使用 publicPath: IS_PROD ? './' : '/glsk-data-view-pd/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开 // publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录 outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录 assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!