- 备品丶机物料·元/㎡
+ 备件、机物料·元/㎡
diff --git a/src/views/home/unitPriceAnalysisComponents/operatingLineBarSale.vue b/src/views/home/unitPriceAnalysisComponents/operatingLineBarSale.vue
index 0d1267e9..bd6878f8 100644
--- a/src/views/home/unitPriceAnalysisComponents/operatingLineBarSale.vue
+++ b/src/views/home/unitPriceAnalysisComponents/operatingLineBarSale.vue
@@ -137,9 +137,10 @@ export default {
},
grid: {
top: 30,
- bottom: 30,
- right: 70,
- left: 60
+ bottom: 5,
+ right: 5,
+ left: 15,
+ containLabel: true
},
xAxis: [
{
diff --git a/src/views/home/unitPriceAnalysisComponents/pieChart.vue b/src/views/home/unitPriceAnalysisComponents/pieChart.vue
index c51d6f46..587ffaa5 100644
--- a/src/views/home/unitPriceAnalysisComponents/pieChart.vue
+++ b/src/views/home/unitPriceAnalysisComponents/pieChart.vue
@@ -86,10 +86,49 @@ export default {
normal: {
align: 'left',
distanceToLabelLine: 2,
- formatter: (params) => [
- `{b|${params.value.toLocaleString()}}`, // 数值(格式化千分位)
- `{hr|■}{c|${params.name}}` // 名称 + 颜色标识
- ].join('\n'),
+ formatter: (params) => {
+ const wrapMixedText = (text, maxUnits = 9, maxLines = 2) => {
+ if (!text) return ''
+ let line = ''
+ let units = 0
+ const lines = []
+ const charUnit = (ch) => {
+ // 简单权重:中文/全角更“宽”
+ if (/[\u4e00-\u9fa5]/.test(ch)) return 1
+ if (/[A-Z]/.test(ch)) return 0.85
+ if (/[a-z0-9]/.test(ch)) return 0.65
+ if (/\s/.test(ch)) return 0.3
+ return 0.8
+ }
+ for (let i = 0; i < text.length; i++) {
+ const ch = text[i]
+ const u = charUnit(ch)
+ // 超过阈值就换行
+ if (units + u > maxUnits && line) {
+ lines.push(line)
+ line = ch
+ units = u
+ if (lines.length >= maxLines) {
+ // 还有剩余就省略
+ const rest = text.slice(i + 1)
+ if (rest) lines[maxLines - 1] = (lines[maxLines - 1] + '...').replace(/\.\.\.\.+$/, '...')
+ return lines.join('\n')
+ }
+ } else {
+ line += ch
+ units += u
+ }
+ }
+ if (line) lines.push(line)
+ return lines.slice(0, maxLines).join('\n')
+ }
+ const nameWrapped = wrapMixedText(params.name, 6, 1)
+ return [
+ `{b|${Number(params.value || 0).toLocaleString()}}`,
+ // 第2行放色块 + 名称第1行;如果名称有第2行,会自然变成第3行
+ `{hr|■}{c|${nameWrapped}}`
+ ].join('\n')
+ },
rich: {
hr: {
color: color,
@@ -112,8 +151,8 @@ export default {
// 标签线样式(动态匹配颜色)
labelLine: {
lineStyle: { color: color },
- length: 10,
- length2: 20,
+ length: 5,
+ length2: 5,
},
// 扇区样式(动态匹配颜色)
itemStyle: { color: color }
@@ -129,7 +168,7 @@ export default {
left: 'center',
top: '35%',
textStyle: {
- fontSize: 18,
+ fontSize: 15,
letterSpacing: 5,
color: 'rgba(0, 0, 0, 0.55)',
fontFamily: 'PingFangSC, PingFang SC'
@@ -140,7 +179,7 @@ export default {
left: 'center',
top: '50%',
textStyle: {
- fontSize: 16,
+ fontSize: 14,
color: 'rgba(0, 0, 0, 0.55)',
fontFamily: 'PingFangSC, PingFang SC'
}
@@ -150,7 +189,7 @@ export default {
{
name: '销量',
type: 'pie',
- radius: ['60%', '80%'],
+ radius: ['50%', '70%'],
center: ['50%', '50%'],
avoidLabelOverlap: false,
label: {
@@ -167,8 +206,6 @@ export default {
},
labelLine: {
show: true,
- length: 0,
- length2: 10,
lineStyle: {
// 若未单独配置标签线颜色,默认取对应数据项的颜色
color: (params) => this.customColors[params.dataIndex % this.customColors.length]
diff --git a/src/views/report/cockpitReport/edit.vue b/src/views/report/cockpitReport/edit.vue
index 6109265b..54e5eb93 100644
--- a/src/views/report/cockpitReport/edit.vue
+++ b/src/views/report/cockpitReport/edit.vue
@@ -12,7 +12,7 @@
取消