Commit fd474e41 by shaojiawen

update: 图表

parent edb90f75
......@@ -30,7 +30,6 @@
<el-tooltip :disabled="codeInfo.memberLabelStatus != 0" content="已删除" placement="top">
<el-tag size="small" :type="codeInfo.memberLabelStatus == 0 ? 'warning' : 'info'">{{ codeInfo.memberLabelName || '--' }}</el-tag>
</el-tooltip>
<!-- <el-tag size="small" type="info">{{ codeInfo.memberLabelName || '--' }}</el-tag> -->
</div>
</div>
<div v-if="codeInfo.statusFlag != 2 && codeInfo.statusFlag" class="flex" style="padding-top:20px;">
......@@ -49,11 +48,9 @@
</el-tabs>
</div>
<el-tabs v-model="activeName" type="card">
<!-- <el-tab-pane label="详情信息" name="first" v-if="$getButtonLimit($buttonCode.infoActCode)" :limit-code="$buttonCode.infoActCode"> -->
<el-tab-pane label="详情信息" name="first" v-if="$getButtonLimit(this.$buttonCode.infoActCode)" :limit-code="$buttonCode.infoActCode">
<act-code-detail-info :enterprise-id="codeInfo.enterpriseId" :welcome-id="codeInfo.welcomeId" :hm-id="$route.query.hmId" @useMemberList="useMemberData"></act-code-detail-info>
</el-tab-pane>
<!-- <el-tab-pane label="数据统计" name="second" v-if="$getButtonLimit($buttonCode.dataActCode)" :limit-code="$buttonCode.dataActCode"> -->
<el-tab-pane label="数据统计" name="second" v-if="$getButtonLimit(this.$buttonCode.dataActCode)" :limit-code="$buttonCode.dataActCode">
<act-code-detail-statistics :hm-id="$route.query.hmId"></act-code-detail-statistics>
</el-tab-pane>
......
......@@ -79,32 +79,25 @@ export default {
data() {
return {
loading: false,
dateList: [
// { bizDate: '2018/8/1', 新增人数: 4623 }
// { bizDate: '2018/8/2', 新增人数: 6145 },
// { bizDate: '2018/8/3', 新增人数: 508 },
// { bizDate: '2018/8/4', 新增人数: 289 },
// { bizDate: '2018/8/5', 新增人数: 289 },
// { bizDate: '2018/8/6', 新增人数: 289 },
// { bizDate: '2018/8/7', 新增人数: 289 },
// { bizDate: '2018/8/8', 新增人数: 289 },
// { bizDate: '2018/8/9', 新增人数: 289 },
// { bizDate: '2018/8/10', 新增人数: 289 },
// { bizDate: '2018/8/11', 新增人数: 289 },
// { bizDate: '2018/8/12', 新增人数: 289 },
// { bizDate: '2018/8/13', 新增人数: 2589 },
// { bizDate: '2018/8/14', 新增人数: 289 },
// { bizDate: '2018/8/15', 新增人数: 289 },
// { bizDate: '2018/8/16', 新增人数: 29 },
// { bizDate: '2018/8/17', 新增人数: 289 },
// { bizDate: '2018/8/18', 新增人数: 9 },
// { bizDate: '2018/8/19', 新增人数: 2189 },
// { bizDate: '2018/8/20', 新增人数: 289 },
// { bizDate: '2018/8/21', 新增人数: 2869 },
// { bizDate: '2018/8/22', 新增人数: 289 },
// { bizDate: '2018/8/23', 新增人数: 2809 }
],
overViewData: { addNumT: 0, addNum: 0, dateList: [] }
overViewData: {
addNumT: 0,
addNum: 0,
dateList: [
// { bizDate: '2018/8/12', addNum: null },
// { bizDate: '2018-07', addNum: 0 }
// { bizDate: '2018/8/14', addNum: null }
// { bizDate: '2018/8/14', addNum: 289 }
// { bizDate: '2018/8/15', addNum: 289 },
// { bizDate: '2018/8/16', addNum: 29 },
// { bizDate: '2018/8/17', addNum: 289 },
// { bizDate: '2018/8/18', addNum: 9 },
// { bizDate: '2018/8/19', addNum: 2189 },
// { bizDate: '2018/8/20', addNum: 289 },
// { bizDate: '2018/8/21', addNum: 2869 },
// { bizDate: '2018/8/22', addNum: 289 },
// { bizDate: '2018/8/23', addNum: 2809 }
]
}
};
},
methods: {
......
<template>
<div>
<div :id="id"></div>
<div :id="id" class="chart--nodata"></div>
<div v-if="!charData.length" class="chart--nodata">
<div>
<img class="image-120" src="@/assets/no-data.svg" />
......@@ -8,17 +8,9 @@
</div>
</div>
</div>
<!-- <div :id="id"></div> -->
<!-- <div v-if="!charData.length" class="chart--nodata">
<div>
<img class="image-120" src="@/assets/no-data.svg" />
<p class="font-14 color-606266 no-data-text">暂无数据</p>
</div>
</div> -->
</template>
<script>
// import G2 from '@antv/g2';
import * as G2 from '@antv/g2';
export default {
components: {},
......@@ -31,7 +23,7 @@ export default {
charData: {
type: Array,
default() {
return []; //{ bizDate: '2018/8/1', 新增人数: 4623 }
return [];
}
},
id: String,
......@@ -59,22 +51,13 @@ export default {
if (!this.charData.length) return;
this.chart = new G2.Chart({
container: this.id,
height: 359,
autoFit: true,
forceFit: true,
width: this.width,
padding: [20, 40, 80, 80]
padding: [40, 40, 40, 40]
});
//装载数据
// this.chart.data(this.charData); // 载入数据源
this.chart.data(this.charData, {
bizDate: {
alias: '日期' //别名
},
addNum: {
alias: '新增人数'
}
});
this.chart.data(this.charData); // 载入数据源
//坐标轴配置(法一配置)
this.chart.axis('bizDate', {
line: {
......@@ -87,7 +70,8 @@ export default {
style: {
fill: '#E4E7ED',
lineDash: [3, 3]
}
},
alignTick: false
},
label: {
style: {
......@@ -162,7 +146,7 @@ export default {
</script>
<style lang="scss" scoped>
.chart--nodata {
height: 256px;
height: 359px;
width: 100%;
display: flex;
justify-content: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment