|
|
|
@ -230,7 +230,6 @@ export default { |
|
|
|
if (!this.$refs.lineChart) return; |
|
|
|
if (!this.$refs.lineChart) return; |
|
|
|
const chartWidth = this.calculateChartWidth(value); |
|
|
|
const chartWidth = this.calculateChartWidth(value); |
|
|
|
this.$refs.lineChart.style.width = chartWidth + 'px'; |
|
|
|
this.$refs.lineChart.style.width = chartWidth + 'px'; |
|
|
|
console.log(98989898989, chartWidth); |
|
|
|
|
|
|
|
const mapBoxEchart = this.$echarts.init(this.$refs.lineChart); |
|
|
|
const mapBoxEchart = this.$echarts.init(this.$refs.lineChart); |
|
|
|
this.mapBoxEchart = mapBoxEchart; |
|
|
|
this.mapBoxEchart = mapBoxEchart; |
|
|
|
|
|
|
|
|
|
|
|
@ -282,7 +281,7 @@ export default { |
|
|
|
if (nodeQuota !== '' && nodeQuota !== null) { |
|
|
|
if (nodeQuota !== '' && nodeQuota !== null) { |
|
|
|
lineCount = 3; |
|
|
|
lineCount = 3; |
|
|
|
} |
|
|
|
} |
|
|
|
const height = lineCount * 20 + 10; |
|
|
|
const height = lineCount * 20 + 15; |
|
|
|
|
|
|
|
|
|
|
|
return [Math.max(maxWidth, 60), height]; |
|
|
|
return [Math.max(maxWidth, 60), height]; |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -296,7 +295,8 @@ export default { |
|
|
|
color: '#fff', |
|
|
|
color: '#fff', |
|
|
|
formatter: params => { |
|
|
|
formatter: params => { |
|
|
|
const nodeData = params.data || params; |
|
|
|
const nodeData = params.data || params; |
|
|
|
const quotaText = nodeData.quota >= 0 ? `${nodeData.quota}个` : ''; |
|
|
|
const quotaText = |
|
|
|
|
|
|
|
nodeData.quota >= 0 || nodeData.quota != null ? `${nodeData.quota}个` : ''; |
|
|
|
let result = `${nodeData.partCode}\n${nodeData.name}`; |
|
|
|
let result = `${nodeData.partCode}\n${nodeData.name}`; |
|
|
|
if (quotaText) { |
|
|
|
if (quotaText) { |
|
|
|
result += '\n' + quotaText; |
|
|
|
result += '\n' + quotaText; |
|
|
|
@ -339,7 +339,7 @@ export default { |
|
|
|
const traverse = (nodes, depth = 0) => { |
|
|
|
const traverse = (nodes, depth = 0) => { |
|
|
|
if (!nodes || nodes.length === 0) return; |
|
|
|
if (!nodes || nodes.length === 0) return; |
|
|
|
maxDepth = Math.max(maxDepth, depth); |
|
|
|
maxDepth = Math.max(maxDepth, depth); |
|
|
|
|
|
|
|
|
|
|
|
nodes.forEach(node => { |
|
|
|
nodes.forEach(node => { |
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
maxChildren = Math.max(maxChildren, node.children.length); |
|
|
|
maxChildren = Math.max(maxChildren, node.children.length); |
|
|
|
|