Commit 77daaa03 by 王志慧

commit

1 parent c2532d2a
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
barChart: '', barChart: '',
option: {}, option: {},
barData: [], barData: [],
key: 1, key: '重要价值',
isBrand: false, isBrand: false,
brandName: '' brandName: ''
} }
...@@ -154,19 +154,24 @@ export default { ...@@ -154,19 +154,24 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
this.getChart() this.getChart()
this.initPieData() this.initPieData(this.key)
}) })
} }
}) })
}, },
initPieData(name) { 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 => { Object.keys(distributionRank).forEach(item => {
this.analyzeData.push({ this.analyzeData.push({
name: item, name: item,
value: distributionRank[item] value: distributionRank[item]
}) })
}) })
}
})
}, },
init(newVal) { init(newVal) {
this.isBrand = false this.isBrand = false
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<pie-chart :id="chart.id" :list="clientData" :colors="chart.colors" @pieAction="pieAction"></pie-chart> <pie-chart :id="chart.id" :list="clientData" :colors="chart.colors" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king> <ran-king :list="brandList"></ran-king>
</template> </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="" /> <img src="../../assets/images/empty.png" alt="" />
</div> </div>
</div> </div>
...@@ -32,14 +32,17 @@ export default { ...@@ -32,14 +32,17 @@ export default {
type: 'gender', type: 'gender',
chart: { chart: {
id: 'sex-pie', id: 'sex-pie',
colors:["#EB6001","#BF98FF","#FF6E76"] colors: ['#EB6001', '#BF98FF', '#FF6E76']
} }
} }
}, },
methods:{ methods: {
pieAction(data){ pieAction(data) {
console.log(this.distributionRank,'客户性别') this.brandList = []
this.brandList = this.distributionRank&&this.distributionRank[data.name]&&Object.keys(this.distributionRank[data.name]) 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!