Commit 348e7d06 by 王志慧

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents aefb8acd 1255d06d
...@@ -166,6 +166,7 @@ p { ...@@ -166,6 +166,7 @@ p {
color: #ffffff; color: #ffffff;
// padding: 4px 8px; // padding: 4px 8px;
font-size: 0.75em; font-size: 0.75em;
overflow: hidden;
.txt-orange { .txt-orange {
color: #eb6001; color: #eb6001;
} }
...@@ -225,4 +226,18 @@ p { ...@@ -225,4 +226,18 @@ p {
} }
} }
} }
::v-deep.line-chart {
width: 100%;
height: 100%;
div {
&:nth-child(1) {
width: 100% !important;
height: 100% !important;
canvas {
width: 100% !important;
height: 100% !important;
}
}
}
}
</style> </style>
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
if (params.brand) this.isGroup = false if (params.brand) this.isGroup = false
this.req = req this.req = req
this.isEmpty = true this.isEmpty = true
// this.flag = false
this.getOverallbase('total') this.getOverallbase('total')
this.getOverallbase('wechat') this.getOverallbase('wechat')
this.getOverallbase('wechatGroup') this.getOverallbase('wechatGroup')
...@@ -189,6 +188,13 @@ export default { ...@@ -189,6 +188,13 @@ export default {
} }
this.tabHead = this.isGroup ? ['前5品牌', '后5品牌'] : ['前5门店', '后5门店'] this.tabHead = this.isGroup ? ['前5品牌', '后5品牌'] : ['前5门店', '后5门店']
this.api.overview[this.isGroup ? 'getBrandOverallbase' : 'getMerchantOverallbase'](params).then(({ code, data }) => { this.api.overview[this.isGroup ? 'getBrandOverallbase' : 'getMerchantOverallbase'](params).then(({ code, data }) => {
this.pageData[queryItem] = {
top: [],
last: [],
incrNum: 0,
returnNum: 0,
totalNum: 0
}
if (code == 0) { if (code == 0) {
let [dataList] = data.dataList let [dataList] = data.dataList
if (dataList) { if (dataList) {
...@@ -211,21 +217,18 @@ export default { ...@@ -211,21 +217,18 @@ export default {
this.pageData[queryItem] = dataList this.pageData[queryItem] = dataList
} }
}).catch(() => {
this.pageData[queryItem] = {
top: [],
last: [],
incrNum: 0,
returnNum: 0,
totalNum: 0
}
}) })
}, },
ObjectToArray (obj) { ObjectToArray (obj) {
let arr = [] let arr = []
if (obj && obj != 'null') JSON.parse(obj).map(e => { if (obj && obj !== 'null') {
Object.keys(e).map(name => arr.push({ name, num: e[name] })) obj = obj.replace('null', '"未知"')
}) let item = JSON.parse(obj)
if (Array.isArray(item)) item.map(e => {
Object.keys(e).map(name => arr.push({ name, num: e[name] }))
})
else Object.keys(item).map(name => arr.push({ name, num: item[name] }))
}
return arr return arr
}, },
getOveralltrend (queryItem) { getOveralltrend (queryItem) {
......
<template> <template>
<div class="content flex"> <div class="content flex">
<div class="logo user-select"> <div class="logo user-select">
<img <img src="@/assets/images/logo.svg" alt="logo" />
src="@/assets/images/logo.svg"
alt="logo"
/>
</div> </div>
<div class="view-title flex user-select">广汇集团客户池数据大屏</div> <div class="view-title flex user-select">广汇集团客户池数据大屏</div>
<div class="time"> <div class="time">
<div class="top flex"> <div class="top flex">
<img <img src="@/assets/images/time.svg" class="icon" />
src="@/assets/images/time.svg" <div class="now">{{ now }}</div>
class="icon"
/>
<div class="now">{{now}}</div>
</div> </div>
<div class="bottom flex"> <div class="bottom flex">
<div class="merchant">已同步门店数:68</div> <div class="merchant">已同步门店数:160</div>
数据截止至 {{yesterday}} 数据截止至 {{ yesterday }}
</div> </div>
</div> </div>
<div class="center-control"> <div class="center-control">
...@@ -26,7 +20,7 @@ ...@@ -26,7 +20,7 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'ViewTitle', name: 'ViewTitle',
data () { data () {
...@@ -49,7 +43,7 @@ export default { ...@@ -49,7 +43,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.content { .content {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -77,7 +71,7 @@ export default { ...@@ -77,7 +71,7 @@ export default {
text-align: right; text-align: right;
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
.top{ .top {
justify-content: flex-end; justify-content: flex-end;
} }
.icon { .icon {
...@@ -94,7 +88,7 @@ export default { ...@@ -94,7 +88,7 @@ export default {
margin-right: 10px; margin-right: 10px;
padding-right: 10px; padding-right: 10px;
position: relative; position: relative;
&::after{ &::after {
position: absolute; position: absolute;
right: 0; right: 0;
top: 50%; top: 50%;
...@@ -115,4 +109,4 @@ export default { ...@@ -115,4 +109,4 @@ export default {
z-index: 2; z-index: 2;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
function getLineOptions(obj) { function getLineOptions (obj) {
const { tooltipFormatter } = obj const { tooltipFormatter } = obj
var lineOptions = { var lineOptions = {
tooltip: { tooltip: {
...@@ -9,7 +9,8 @@ function getLineOptions(obj) { ...@@ -9,7 +9,8 @@ function getLineOptions(obj) {
color: '#FFFFFF', color: '#FFFFFF',
fontSize: '8px' fontSize: '8px'
}, },
formatter: tooltipFormatter || '' formatter: tooltipFormatter || '',
confine:true
}, },
grid: { grid: {
left: '3%', left: '3%',
......
...@@ -95,8 +95,8 @@ export default { ...@@ -95,8 +95,8 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -97,8 +97,8 @@ export default { ...@@ -97,8 +97,8 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
rate: item.rate || 0, rate: item.rate.toFixed(2) || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
rate: item.rate || 0, rate: item.rate.toFixed(2) || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -113,9 +113,9 @@ export default { ...@@ -113,9 +113,9 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
rate: item.rate || 0, rate: item.rate.toFixed(2) || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
}) })
this.dataList.push({ this.dataList.push({
num: item.num || 0, num: item.num || 0,
rate: item.rate || 0, rate: item.rate.toFixed(2) || 0,
hrate: item.hrate || 0, hrate: item.hrate.toFixed(2) || 0,
trate: item.trate || 0, trate: item.trate.toFixed(2) || 0,
statDate: item.statDate, statDate: item.statDate,
topList: topList, topList: topList,
lastList: lastList lastList: lastList
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-07-04 18:39:00 * @LastEditTime: 2022-07-05 17:16:23
--> -->
<template> <template>
<div> <div>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<div class="ranking-content"> <div class="ranking-content">
<div class="ranking-item" v-for="(item, index) in flowData" :key="index"> <div class="ranking-item" v-for="(item, index) in flowData" :key="index">
<span>{{ index + 1 }}</span> <span class="ranking-sort">{{ index + 1 }}</span>
<span class="ranking-name"> <span class="ranking-name">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.brand" /> <marquee :direction="directionTimer" :delay="delayTimer" :text="item.brand" />
</span> </span>
...@@ -187,6 +187,7 @@ export default { ...@@ -187,6 +187,7 @@ export default {
'mouseover', 'mouseover',
utils.debounce(data => { utils.debounce(data => {
this.getSaleTrans(this.paramsData, data.data.type) this.getSaleTrans(this.paramsData, data.data.type)
this.isActive = 1
}), }),
1000 / 60 1000 / 60
) )
...@@ -276,6 +277,11 @@ export default { ...@@ -276,6 +277,11 @@ export default {
align-items: center; align-items: center;
line-height: 2.1vh; line-height: 2.1vh;
height: 2.1vh; height: 2.1vh;
.ranking-sort {
display: inline-block;
width: 0.3vw;
text-align: center;
}
.ranking-name { .ranking-name {
width: calc(100% - 33% - 28px); width: calc(100% - 33% - 28px);
} }
......
...@@ -8,11 +8,23 @@ ...@@ -8,11 +8,23 @@
<template> <template>
<div> <div>
<div class="title">转化趋势</div> <div class="title">转化趋势</div>
<div v-show="hasData" style="width: 100%"> <div
<div id="lineTrend" :style="{ height: height - 4.1 + 'vh' }"></div> v-show="hasData"
class="linetrend-box"
>
<div
id="lineTrend"
:style="{ height: height - 4.1 + 'vh' }"
></div>
</div> </div>
<div v-show="!hasData" class="empty"> <div
<img src="../../assets/images/empty.png" alt="" /> v-show="!hasData"
class="empty"
>
<img
src="../../assets/images/empty.png"
alt=""
/>
</div> </div>
</div> </div>
</template> </template>
...@@ -24,7 +36,7 @@ export default { ...@@ -24,7 +36,7 @@ export default {
name: 'Trend', name: 'Trend',
props: ['height'], props: ['height'],
mixins: [changeMixin], mixins: [changeMixin],
data() { data () {
return { return {
echartsTrend: {}, echartsTrend: {},
option: {}, option: {},
...@@ -34,17 +46,17 @@ export default { ...@@ -34,17 +46,17 @@ export default {
hasData: true hasData: true
} }
}, },
mounted() { mounted () {
this.echartsTrend = echarts.init(document.getElementById('lineTrend')) this.echartsTrend = echarts.init(document.getElementById('lineTrend'))
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.echartsTrend.resize() this.echartsTrend.resize()
}) })
}, },
methods: { methods: {
init(val) { init (val) {
this.getChartData(val) this.getChartData(val)
}, },
getChartData(val) { getChartData (val) {
var params = { var params = {
req: { req: {
// queryItem: 'enter', // queryItem: 'enter',
...@@ -86,13 +98,14 @@ export default { ...@@ -86,13 +98,14 @@ export default {
this.hasData = false this.hasData = false
}) })
}, },
draw(reportType) { draw (reportType) {
this.option = { this.option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
show: true, show: true,
borderWidth: 0, borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)', backgroundColor: 'rgba(68,68,68,0.80)',
confine: true,
// position: (point, params, dom, rect, size) => { // position: (point, params, dom, rect, size) => {
// var x = 0 // x坐标位置 // var x = 0 // x坐标位置
// var y = 0 // y坐标位置 // var y = 0 // y坐标位置
...@@ -226,3 +239,9 @@ export default { ...@@ -226,3 +239,9 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped>
.linetrend-box {
width: 100%;
overflow: hidden;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!