1.31 财务分析,财务数据模块完善,产业链桑基图展示
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
流向关系
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view v-if="center_index==0" class="bottom">
|
||||
<view class="type flex">
|
||||
<view v-for="(item,index) in types" :key="index" class="item flex flex1">
|
||||
<view :class="'contentC flexColumnCenter flex1 '+(typeIndex==index?item.type:'')" @click="typeIndex = index">
|
||||
@@ -84,11 +84,16 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="center_index==1" style="height: 500rpx;">
|
||||
<l-echart ref="chartRef"></l-echart>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
const echarts = require('../../uni_modules/lime-echart/static/echarts.min.js');
|
||||
|
||||
export default {
|
||||
name: "cyl-view",
|
||||
data() {
|
||||
@@ -115,15 +120,34 @@
|
||||
}
|
||||
],
|
||||
typeIndex: 0,
|
||||
|
||||
option:{
|
||||
legend:{
|
||||
show:false,
|
||||
},
|
||||
grid:{
|
||||
left:'2%',
|
||||
right:'2%',
|
||||
top:'5%',
|
||||
bottom:'30%'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'sankey',
|
||||
name:'经营现金流',
|
||||
data: [],
|
||||
links:[],
|
||||
}
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
props:{
|
||||
valueChainAnalysisInfo:Object,
|
||||
upstreamList:Array, //上游供应链
|
||||
upstreamList:Array, //上游供应链
|
||||
coreEnterpriseList:Array, //核心企业
|
||||
downstreamList:Array, //下游客户
|
||||
totalNodes:Number, //总节点数
|
||||
valueChainFlowsList:Array //产业链流向数据
|
||||
},
|
||||
watch:{
|
||||
valueChainAnalysisInfo(newValue)
|
||||
@@ -131,11 +155,46 @@
|
||||
this.types[0].count = newValue.upstream_nodes
|
||||
this.types[1].count = newValue.company_nodes
|
||||
this.types[2].count = newValue.downstream_nodes
|
||||
},
|
||||
valueChainFlowsList(newValue)
|
||||
{
|
||||
let data = []
|
||||
let links = []
|
||||
let name = []
|
||||
for (let item of newValue) {
|
||||
if(name.indexOf(item.source.node_name)==-1)
|
||||
{
|
||||
name.push(item.source.node_name)
|
||||
data.push({name:item.source.node_name})
|
||||
}
|
||||
links.push({source: item.source.node_name, target: item.target.node_name, value: item.flow_metrics.flow_ratio})
|
||||
}
|
||||
this.option.series[0].data = data
|
||||
this.option.series[0].links = links
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeCenterIndex(index) {
|
||||
this.center_index = index
|
||||
methods: {
|
||||
async init() {
|
||||
// chart 图表实例不能存在data里
|
||||
const chart = await this.$refs.chartRef.init(echarts);
|
||||
// chart.on('click',function (params) {
|
||||
// console.log(params)
|
||||
// })
|
||||
console.log(chart)
|
||||
console.log(this.option)
|
||||
chart.setOption(this.option)
|
||||
|
||||
},
|
||||
changeCenterIndex(index) {
|
||||
if(this.center_index!=index) {
|
||||
this.center_index = index
|
||||
if(index==1) {
|
||||
let that = this
|
||||
setTimeout(function() {
|
||||
that.init()
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
clickAction(item) {
|
||||
this.$emit('detail',item)
|
||||
|
||||
Reference in New Issue
Block a user