Commit 79662a93 by 前端

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

2 parents 560e45c4 dbdcbbe5
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"dev": "npm run serve" "dev": "npm run serve"
}, },
"dependencies": { "dependencies": {
"TagCloud": "^2.4.0",
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* @LastEditTime: 2023-07-07 18:01:41 * @LastEditTime: 2023-07-07 18:01:41
--> -->
<template> <template>
<div class="main-box"> <div class="text-box" :style="{'font-size': fontSize + 'px'}">{{ title }}</div>
<div class="trapezoid"> <div class="text-box">{{title}}</div></div>
</div>
</template> </template>
<script> <script>
...@@ -19,6 +17,10 @@ export default { ...@@ -19,6 +17,10 @@ export default {
title: { title: {
type: String, type: String,
default: '标题' default: '标题'
},
fontSize: {
type: Number,
default: 24
} }
}, },
...@@ -33,24 +35,12 @@ export default { ...@@ -33,24 +35,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-box { .text-box {
position: relative; font-family: SourceHanSansCN-Bold;
background-image: url('../assets/images/title-bg.png'); font-weight: 700;
background-repeat: no-repeat; letter-spacing: 0;
background-size: 9.04vw 3.33vh; background: linear-gradient(to right, #01A4F9, #6DF5F9); /* 从左到右渐变 */
} -webkit-background-clip: text; /* Safari/Chrome支持该属性 */
.trapezoid { color: transparent; /* 将文本颜色设置为透明 */
height: 3.33vh;
.text-box {
// width: 126px;
height: 3.33vh;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 3.33vh;
margin-left: 1.67vw;
}
} }
</style> </style>
...@@ -28,6 +28,13 @@ const pages = [ ...@@ -28,6 +28,13 @@ const pages = [
isTab: true, isTab: true,
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
},
{
name: 'lifeSceneDataPage',
meta: {
isTab: true,
backgroundColor: '#F7F7F7'
}
} }
] ]
const keepAlives = [] const keepAlives = []
......
<!--
* @Description: 汽车全生命周期场景图数据页
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-08-22 17:31:50
-->
<template>
<div class="view-content">
<div class="content">
<LifeSceneLeft></LifeSceneLeft>
<LifeSceneCenter></LifeSceneCenter>
<LifeSceneRight></LifeSceneRight>
</div>
</div>
</template>
<script>
import LifeSceneLeft from "../../lifeSceneDataPage/LifeSceneLeft.vue"
import LifeSceneCenter from "../../lifeSceneDataPage/LifeSceneCenter.vue"
import LifeSceneRight from "../../lifeSceneDataPage/LifeSceneRight.vue"
export default {
name: 'ViewLifeSceneData',
components: {
LifeSceneLeft,
LifeSceneCenter,
LifeSceneRight
},
data() {
return {
}
},
created() {
},
mounted() { },
methods: {
}
}
</script>
<style lang="scss" scoped>
.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 0;
// margin-top: 1.78vh;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="center">
<div class="center-top">
</div>
</div>
</template>
<script>
export default {
name: 'LifeSceneCenter',
components: {
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.center {
width: 31.67vw;
&-top {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="left">
<div class="left-top">
</div>
<div class="left-center">
<AIMerchant />
</div>
</div>
</template>
<script>
import AIMerchant from './components/AIMerchant.vue';
export default {
name: 'LifeSceneLeft',
components: {
AIMerchant
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.left {
width: 31.67vw;
&-top {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="right">
<div class="right-top">
</div>
</div>
</template>
<script>
export default {
name: 'LifeSceneRight',
components: {
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.right {
width: 31.67vw;
&-top {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="AI-box">
<BoxTitle :title="'AI对话调用次数及覆盖门店'" :fontSize="18"></BoxTitle>
<img class="bottom-line" src="@/assets/images/bottomLine.png" alt="">
<BarLineChart ref="AITalkRef" height="14.35vh" domId="AITalk" :dataList.sync="AIBarLineData"></BarLineChart>
</div>
</template>
<script>
import { AIBarLineData } from "../const/index"
import BoxTitle from '../../../components/BoxTitle.vue';
import BarLineChart from './BarLineChart.vue';
export default {
name: 'AIMerchant',
components: { BoxTitle, BarLineChart },
data() {
AIBarLineData
return {
};
},
mounted() {
},
methods: {
},
};
</script>
<style lang="scss" scoped>
.AI-box {
width: 21.04vw;
height: 23.8vh;
padding: 1.85vh;
.bottom-line {
width: 16.28vw;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-23 16:22:16
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import utils from '../../../utils/util'
import * as echarts from 'echarts'
import getBarLineOptions from './BarLineOptions'
export default {
name: 'BarLineChart',
props: {
height: {
type: String
},
domId: {
type: String,
default: 'bar-line'
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
barLineOptions: [],
moveAttr: {
// speed: 900,
seriesIndex: 0,
dataIndex: 0
},
timer: null
}
},
// created() {
// this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
// },
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
this.tooltipFormatterObj.forEach(item => {
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${item.addSymbol || ''}</div></div>`
})
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
import * as echarts from 'echarts'
import utils from '../../../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: tooltipFormatter || ''
},
xAxis: {
data: []
},
yAxis: [
{
name: '¥',
splitLine: {
show: false
}
},
{
name: '',
type: 'value',
min: 0,
max: 100,
interval: 20,
axisLabel: {
formatter: '{value}%'
},
splitLine: {
lineStyle: {
color: '#1d2a38'
}
}
}
],
grid: {
left: '3%',
right: '2%',
top: '20%',
bottom: '6%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
data: [],
label: {
show: true,
position: 'top',
color: '#fff',
formatter: (params) => {
return utils.numAddSymbol(params.value)
}
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#22D8FF'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#223FA9'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
},
{
name: 'bar2',
type: 'bar',
min: 100,
label: {
show: true,
position: 'top',
color: '#fff',
formatter: (params) => {
return utils.numAddSymbol(params.value)
}
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#2AD191'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#0E958D'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
},
{
name: 'Dynamic Line',
type: 'line',
yAxisIndex: 1,
data: []
}
]
}
return barLineOption
}
export default getBarLineOptions
<template>
<div>
<di class="tagcloud"></di>
</div>
</template>
<script>
const texts = ['3D', 'TagCloud', 'JavaScript', 'CSS3', 'Animation', 'Interactive', 'Mouse', 'Rolling', 'Sphere', '6KB', 'v2.x']
import TagCloud from 'TagCloud'
export default {
name: 'HotWords',
data() {
return {}
},
mounted() {
TagCloud('.tagcloud', texts)
}
}
</script>
<style lang="scss">
.tagcloud {
width: 16vw;
height: 16vw;
background-image: url(../../assets/images/hot-words-bg.png);
background-size: 100%;
span {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #0185F9, #53FAFF);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
</style>
<template>
<div class="statistics">
<div class="statistics-item" v-for="(item, index) in list" :key="index" :style="{'width': 100 / list.length + '%'}">
<div class="statistics-top">
<div class="statistics-name">{{item.name}}</div>
<div class="statistics-price"><span class="statistics-unit" v-if="item.unitType == 'left'">{{item.unit}}</span><span class="statistics-price-number">{{numAddSymbol(item.value)}}</span><span v-if="item.unitType == 'right'">{{item.unit}}</span></div>
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}%</span></div>
</div>
<div class="statistics-bottom" v-if="item.bottomLabel || item.bottomType">
<template v-if="item.bottomType == 'money'">
<span> {{item.bottomLabel}}</span>
<span>¥{{numAddSymbol(item.bottomValue)}}</span>
</template>
<template v-else-if="item.bottomType == 'slot'">
<slot :name="item.valueName" :[item.valueName]="item"></slot>
</template>
<template v-else-if="item.bottomType == 'ratio'">
<div class="ratio">
<div class="ratio-left">{{item.ratioLeftLabel}}<span :class="item.ratioLeftValue > 0 ? 'positive' : 'negative'">{{item.ratioLeftValue}}%</span></div>
<div class="ratio-right">{{item.ratioRightLabel}}<span :class="item.ratioRightValue > 0 ? 'positive' : 'negative'">{{item.ratioRightValue}}%</span></div>
</div>
</template>
<template v-else>
<span>{{item.bottomLabel}}</span>
<span>{{numAddSymbol(item.bottomValue)}}</span>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'StatisticsBox',
props: {
list: {
type: Array
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data() {
return {
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
color: #fff;
height: 11.78vh;
&-item {
padding: 0.89vh 0.53vw;
margin-right: 1.11vw;
background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
&:last-child {
margin-right: 0;
}
}
&-top {
position: relative;
padding-left: 0.3vw;
&-rate {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
color: #95ACD9;
span {
color: #EB6001;
}
}
}
&-name {
font-weight: 500;
font-size: 14px;
margin-bottom: 0.89vh;
height: 2.22vh;
}
&-unit {
padding-right: 0.56vw;
}
&-price {
display: flex;
align-items: center;
color: #25D6FF;
font-weight: 600;
font-size: 14px;
height: 3.11vh;
&-number {
padding-right: 0.56vw;
font-size: 20px;
color: #5894FF;
background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
}
&-bottom {
display: flex;
justify-content: space-between;
font-size: 12px;
color: #95ACD9;
border-top: 1px solid #2A3D72;
padding: 0.89vh 0.3vw 0;
margin-top: 0.89vh;
.ratio {
display: flex;
width: 100%;
justify-content: space-between;
.positive,
.negative{
display: inline-block;
margin-left: 0.28vw;
}
.positive {
color: #EB6001;
}
.negative {
color: #16E193;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
const AIBarLineData = [
{
statMonth: '2023-10',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
},
{
statMonth: '2023-11',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
},
{
statMonth: '2023-12',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
},
{
statMonth: '2024-01',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
},
{
statMonth: '2024-02',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
},
{
statMonth: '2024-03',
outputvalue: 2032486.1,
perCusTrans: 1347.8,
conversionRate: 55.0
}
]
export {
AIBarLineData
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!