Browse Source

需求优化

master
xuhuajiao 1 day ago
parent
commit
3c72ce79e5
  1. 4
      src/views/archivesManage/RFIDArchives/returnArchives/index.vue
  2. 75
      src/views/environmentalScreen/module/catePie.vue

4
src/views/archivesManage/RFIDArchives/returnArchives/index.vue

@ -127,9 +127,9 @@ export default {
isReturn: true,
selections: [],
queryOption: [
{ value: 'caseName', label: '档案盒' },
{ value: 'orderNo', label: '单据号' },
{ value: 'borrowerName', label: '借阅人' },
{ value: 'caseName', label: '档案盒' }
{ value: 'borrowerName', label: '借阅人' }
// { value: 'barcode', label: '' }
],
isRfidReading: false, // RFIDtrue=false=

75
src/views/environmentalScreen/module/catePie.vue

@ -25,12 +25,13 @@ export default {
},
refreshtime: {
type: Number,
default: null //
default: null
}
},
data() {
return {
chart: null
chart: null,
timer: null //
}
},
watch: {
@ -45,10 +46,10 @@ export default {
}
},
mounted() {
// this.initChart()
this.refreshEchart()
},
beforeDestroy() {
clearInterval(this.timer) //
if (this.chart) {
this.chart.dispose()
this.chart = null
@ -58,7 +59,7 @@ export default {
refreshEchart() {
if (this.refreshtime) {
this.timer = setInterval(() => {
this.initChart()
this.drawChart() //
}, this.refreshtime)
} else {
this.initChart()
@ -81,19 +82,25 @@ export default {
? this.cateData
: [{ name: '无告警数据', value: 1, itemStyle: { color: '#666666' }}]
// 00
const processedData = chartData.map(item => ({
...item,
value: item.value === 0 ? 0 : item.value
}))
// ========== 0 ==========
const processedData = chartData.map(item => {
// 00.010
const displayValue = item.value === 0 ? 0.01 : item.value
return {
...item,
value: displayValue,
// tooltip/label
rawValue: item.value
}
})
const option = {
backgroundColor: 'transparent',
tooltip: {
trigger: 'item',
textStyle: { fontSize: 12 },
// Tooltip ++
formatter: '{b}: {c} 次 ({d}%)'
// 0
formatter: (params) => `${params.name}: ${params.data.rawValue} 次 (0%)`
},
legend: {
bottom: 10,
@ -118,27 +125,30 @@ export default {
name: '当日告警统计',
type: 'pie',
radius: ['30%', '60%'],
center: ['50%', '40%'],
avoidLabelOverlap: false,
center: ['50%', '44%'],
avoidLabelOverlap: true, //
// 线0
labelLine: {
show: true,
length: 10,
length2: 20,
// 0线
length: 10, //
length2: 15, //
smooth: 0.2, // 线
lineStyle: (params) => ({
color: params.data.value < 0.1 ? 'rgba(255,255,255,0.3)' : '#ffffff'
color: params.data.rawValue === 0
? 'rgba(255,255,255,0.3)'
: '#ffffff',
width: 1
})
},
label: {
show: true,
fontSize: 11,
color: '#ffffff',
// {d}%
formatter: function(params) {
// 0
const value = params.value < 0.1 ? 0 : params.value
return `${value}`
}
// 0
formatter: (params) => `${params.data.rawValue}`,
//
position: 'outer',
distance: 20 //
},
emphasis: {
label: {
@ -152,9 +162,14 @@ export default {
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
data: processedData, // 使0
data: processedData,
animationDuration: 1000,
animationEasing: 'cubicOut'
animationEasing: 'cubicOut',
//
itemStyle: {
borderColor: 'transparent',
borderWidth: 1
}
}
]
}
@ -180,10 +195,18 @@ export default {
border-radius: 4px !important;
}
// 0
// 0
:deep(.ec-label) {
&[style*="0 次"] {
fill: rgba(255,255,255,0.5) !important;
}
}
//
:deep(.ec-pie) {
g > path {
stroke: transparent !important;
stroke-width: 1px !important;
}
}
</style>
Loading…
Cancel
Save