Commit 77daaa03 by 王志慧

commit

1 parent c2532d2a
......@@ -42,7 +42,7 @@ export default {
barChart: '',
option: {},
barData: [],
key: 1,
key: '重要价值',
isBrand: false,
brandName: ''
}
......@@ -154,19 +154,24 @@ export default {
}
this.$nextTick(() => {
this.getChart()
this.initPieData()
this.initPieData(this.key)
})
}
})
},
initPieData(name) {
const distributionRank = this.distributionRank[this.key]
this.analyzeData = []
datas.Customer.valueType.value.map(item => {
if (item.name == name) {
const distributionRank = this.distributionRank[item.value]
Object.keys(distributionRank).forEach(item => {
this.analyzeData.push({
name: item,
value: distributionRank[item]
})
})
}
})
},
init(newVal) {
this.isBrand = false
......
......@@ -16,7 +16,7 @@
<pie-chart :id="chart.id" :list="clientData" :colors="chart.colors" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king>
</template>
<div class="empty" style="height:12.7vh" v-else>
<div class="empty" style="height: 12.7vh" v-else>
<img src="../../assets/images/empty.png" alt="" />
</div>
</div>
......@@ -32,14 +32,17 @@ export default {
type: 'gender',
chart: {
id: 'sex-pie',
colors:["#EB6001","#BF98FF","#FF6E76"]
colors: ['#EB6001', '#BF98FF', '#FF6E76']
}
}
},
methods:{
pieAction(data){
console.log(this.distributionRank,'客户性别')
this.brandList = this.distributionRank&&this.distributionRank[data.name]&&Object.keys(this.distributionRank[data.name])
methods: {
pieAction(data) {
this.brandList = []
let array = this.distributionRank && this.distributionRank[data.name]
for (let i of array) {
this.brandList.push(Object.keys(i)[0])
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!