Commit 4859d0fd by 匡雅琴

Merge branch 'v1.0.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v1.0.0

2 parents f4801d83 a6040b5b
<!--
* @Description: 下拉框组件
* @Author: huyue
* @Date: 2023-07-05 15:11:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 17:19:32
-->
<template>
<div v-show="isShow" class="select-box" :style="{'width': boxWidth}">
<div class="year-item" :class="(isObject ? item[valueName] : item) == value ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click="select(item)">{{isObject ? item[labelName] : item}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'SelectBox',
props: {
isShow: {
type: Boolean,
default: false
},
dataList: {
type: Array,
default: () => []
},
isObject: {
type: Boolean,
default: false
},
labelName: {
type: String,
default: 'label'
},
valueName: {
type: String,
default: 'value'
},
boxWidth: {
type: String
}
},
data() {
return {
value: ''
}
},
mounted() {
const { valueName, isObject, dataList } = this
this.value = isObject ? dataList[0][valueName] : dataList[0]
},
methods: {
select(item) {
const { valueName, isObject } = this
this.value = isObject ? item[valueName] : item
this.$emit('selectVal', item)
}
}
}
</script>
<style scoped lang='scss'>
.select-box {
position: absolute;
top: 4.8vh;
left: 0;
background-color: #051526;
padding: 16px 20px;
box-sizing: border-box;
z-index: 1;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
.year-item {
margin-bottom: 8px;
color: #C9C9C9;
cursor: pointer;
&:hover {
color: #FFFFFF;
}
&:last-child {
margin-bottom: 0;
}
&.active {
color: #FFFFFF;
}
}
}
</style>
......@@ -5,29 +5,34 @@
{{year}}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="">
</div>
<div v-show="isShow" class="select-year">
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dateList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div>
<SelectBox :isShow="isShow" :dataList="dataList" :boxWidth="'8.61vw'" @selectVal="selectVal"></SelectBox>
<!-- <div v-show="isShow" class="select-year">
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div> -->
</div>
业务开始时间:2022年6月30日</div>
</template>
<script type='text/ecmascript-6'>
import datas from '@/utils/data'
export default {
name: 'ViewDate',
data() {
return {
isShow: false,
dateList: ['2023', '2022', '2021', '2020'],
year: '2023'
dataList: datas.DefaultData.yearList,
year: ''
}
},
mounted() {
this.year = this.dataList[0]
},
methods: {
switchYear() {
this.isShow = !this.isShow
},
selectYear(item) {
console.log(item)
this.year = item
selectVal(val) {
console.log(val)
this.year = val
this.switchYear()
}
}
......@@ -46,30 +51,6 @@ export default {
.year-plugin {
position: relative;
}
.select-year {
position: absolute;
top: 4.8vh;
width: 8.61vw;
background-color: #051526;
padding: 16px 20px;
box-sizing: border-box;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
.year-item {
margin-bottom: 8px;
color: #C9C9C9;
cursor: pointer;
&:hover {
color: #FFFFFF;
}
&:last-child {
margin-bottom: 0;
}
&.active {
color: #FFFFFF;
}
}
}
.year {
display: flex;
align-items: center;
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:57:40
* @LastEditTime: 2023-07-06 11:45:34
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -11,8 +11,14 @@
<div class="logo user-select">
<img style="height: 2.89vh" src="@/assets/images/logo.png" alt="logo" />
</div>
<div>
<div>业务数据</div>
<div class="tab">
<div class="tab-item first-tab" @click.self="jump('home')">
{{ firstTab.label }}
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" :dataList="dataList" :boxWidth="'17.1vw'" isObject @selectVal="selectVal"></SelectBox>
</div>
<div class="tab-item other-tab" @click="jump('operational')">运营数据</div>
<div class="tab-item other-tab" @click="jump('interior')">内部数据</div>
</div>
<!-- <div class="view-title user-select">嘀加智慧门店运营看板</div> -->
<div class="time">
......@@ -24,21 +30,43 @@
</template>
<script type="text/ecmascript-6">
import datas from '@/utils/data'
export default {
name: 'ViewTitle',
data() {
return {
now: new Date().format('yyyy-MM-dd hh:mm:ss')
isShow: false,
dataList: datas.DefaultData.businessList,
firstTab: '',
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
isFirst: true
}
},
mounted() {
this.timer()
this.firstTab = this.dataList[0]
},
methods: {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
openSelect() {
this.isShow = !this.isShow
},
selectVal(val) {
console.log(val)
this.firstTab = val
this.$bus.$emit('selectVal', val.value)
this.openSelect()
},
jump(val) {
console.log(val)
let _val = val
this.isFirst = val === 'home'
if (val === 'home') _val = this.firstTab.value
this.$bus.$emit('selectVal', _val)
}
}
}
......@@ -65,7 +93,7 @@ export default {
.top {
justify-content: flex-end;
.now {
min-width: 9.3vw;
width: 10.97vw;
}
}
.icon {
......@@ -75,4 +103,33 @@ export default {
}
}
}
.tab {
display: flex;
// align-items: center;
color: #FFFFFF;
font-size: 16px;
&-item {
display: flex;
align-items: center;
height: 4.44vh;
padding: 0 1.36vw;
box-sizing: border-box;
margin-right: 0.56vw;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223C 99%);
cursor: pointer;
}
.first-tab {
position: relative;
.arrow-down {
margin-left: 0.28vw;
width: 1.39vw;
height: 2.22vh;
}
.select-box {
left: -2px;
}
}
}
</style>
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: huyue
* @LastEditTime: 2023-07-04 16:48:30
* @LastEditTime: 2023-07-05 16:35:22
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
......@@ -26,7 +26,7 @@ import Bus from '../src/bus' //这是我的路径,正确引用你们的路径
Vue.prototype.$bus = Bus
Vue.prototype.$echarts = echarts
Vue.prototype.to = function (name, params) {
Vue.prototype.to = function(name, params) {
if (name === -1) {
router.go(-1)
return
......
......@@ -55,6 +55,7 @@ const getPages = _ => {
if (e.meta && e.meta.keepAlive) keepAlives.push(name)
return route
})
console.log(router)
return [router]
}
export const keeps = keepAlives
......
const DefaultData = {
yearList: ['2023', '2022', '2021', '2020'],
businessList: [
{
label: '业务数据 | 1.0太阳膜采购',
value: '1'
},
{
label: '业务数据 | 1.1精品升级',
value: '2'
},
{
label: '业务数据 | 1.3售后众筹',
value: '3'
},
{
label: '业务数据 | 2.1会员权益',
value: '4'
}
]
}
export default Object.freeze({
DefaultData
})
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-04 11:49:12
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:05:05
* @LastEditTime: 2023-07-06 11:00:53
-->
<!-- home -->
<template>
......@@ -20,12 +20,11 @@
</template>
<script>
export default {
data () {
data() {
return {
}
},
mounted () { },
mounted() { },
methods: {}
}
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:24:08
-->
<template>
<div>
<Charts></Charts>
</div>
</template>
<script>
export default {
name: 'ViewBoutique',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 10:10:40
-->
<template>
<div class="layout">
<view-container>
<template #content>
众筹
</template>
</view-container>
</div>
</template>
<script>
export default {
name: 'ViewCrowdfunding',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 10:09:59
-->
<template>
<div class="layout">
<view-container>
<template #content>
<Charts></Charts>
</template>
</view-container>
</div>
</template>
<script>
export default {
name: 'ViewEquity',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 10:13:42
-->
<template>
<div class="layout">
<view-container>
<template #content>
内部数据
</template>
</view-container>
</div>
</template>
<script>
export default {
name: 'ViewInterior',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 10:14:47
-->
<template>
<div class="layout">
<view-container>
<template #content>
运营数据c
</template>
</view-container>
</div>
</template>
<script>
export default {
name: 'ViewOperational',
data() {
return {}
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
<!--
* @Description: 内容
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:21:44
-->
<template>
<div class="view-content">
<ViewDate></ViewDate>
<div class="content">
<ContentLeft></ContentLeft>
<ContentRight></ContentRight>
</div>
</div>
</template>
<script>
import ContentLeft from './ContentLeft.vue'
import ContentRight from './ContentRight.vue'
export default {
name: 'ViewSolar',
components: {
ContentLeft,
ContentRight
},
props: {
},
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.view-content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.78vh 24px;
gap: 0 16px;
}
.content {
display: flex;
justify-content: space-between;
padding: 1.78vh 0;
> div {
// height: 100%;
}
}
</style>
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-06 10:19:05
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:07:11
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
console.log(component.name)
Vue.component(component.name, component)
})
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-05 10:41:52
* @LastEditTime: 2023-07-06 11:26:17
-->
<template>
<div class="layout">
......@@ -13,24 +13,65 @@
</view-title>
</template>
<template #content>
<view-content></view-content>
<!-- <view-content></view-content> -->
<components :is="tabName"></components>
</template>
</view-container>
</div>
</template>
<script>
import ViewContent from './components/ViewContent.vue'
import './components'
// import ViewContent from './components/ViewContent.vue'
export default {
name: '',
components: {
ViewContent
// ViewContent
},
computed: {
tabName() {
let sname
switch (this.activeName) {
case '1':
sname = 'ViewSolar'
break
case '2':
sname = 'ViewBoutique'
break
case '3':
sname = 'ViewCrowdfunding'
break
case '4':
sname = 'ViewEquity'
break
case 'operational':
sname = 'ViewOperational'
break
case 'interior':
sname = 'ViewInterior'
break
case 'home':
sname = 'ViewSolar'
break
}
return sname
}
},
data() {
return {}
return {
activeName: '1'
}
},
mounted() {
this.$bus.$on('selectVal', data => {
console.log(data)
this.activeName = data
})
},
mounted() { },
methods: {
// selectVal(val) {
// console.log(val)
// }
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!