Browse Source

需求优化

master
xuhuajiao 2 months 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, isReturn: true,
selections: [], selections: [],
queryOption: [ queryOption: [
{ value: 'caseName', label: '档案盒' },
{ value: 'orderNo', label: '单据号' }, { value: 'orderNo', label: '单据号' },
{ value: 'borrowerName', label: '借阅人' },
{ value: 'caseName', label: '档案盒' }
{ value: 'borrowerName', label: '借阅人' }
// { value: 'barcode', label: '' } // { value: 'barcode', label: '' }
], ],
isRfidReading: false, // RFIDtrue=false= isRfidReading: false, // RFIDtrue=false=

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

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