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