集团不请求接口

This commit is contained in:
chenlin
2026-01-08 12:32:11 +08:00
parent 5462cdb292
commit 801530d011
2 changed files with 39 additions and 28 deletions

View File

@@ -202,17 +202,6 @@ const handleMajorClick = () => {
window.open('http://10.0.64.20/pms/workorder-list', '_blank')
}
watch(() => props.hiddenDangerData?.progress, (newVal, oldVal) => {
console.log('HiddenDangerPanel watch 触发progress 数据:', newVal, '旧数据:', oldVal)
// 确保每次数据变化都更新图表
if (newVal) {
refreshProcessCharts(newVal)
} else {
// 即使数据为空,也要显示空图表
refreshProcessCharts(null)
}
}, { deep: true, immediate: true })
// 辅助函数:安全地将值转换为数字,处理 NaN 和字符串 "NaN" 的情况
const safeNumber = (val: any): number => {
if (val === null || val === undefined || val === '' || val === 'NaN') {
@@ -310,11 +299,6 @@ const refreshProcessCharts = (process): void => {
// chartKey.value = Date.now()
}
watch(() => props.hiddenDangerData?.top3Types, (newVal) => {
refreshTop3TypesCharts(newVal)
}, { deep: true })
// 更新图表数据
const refreshTop3TypesCharts = (top3Types): void => {
if (!top3Types || !Array.isArray(top3Types) || top3Types.length === 0) {
@@ -336,6 +320,21 @@ const refreshTop3TypesCharts = (top3Types): void => {
top3TypesChartOption.value = option
}
watch(() => props.hiddenDangerData?.progress, (newVal, oldVal) => {
console.log('HiddenDangerPanel watch 触发progress 数据:', newVal, '旧数据:', oldVal)
// 确保每次数据变化都更新图表
if (newVal) {
refreshProcessCharts(newVal)
} else {
// 即使数据为空,也要显示空图表
refreshProcessCharts(null)
}
}, { deep: true, immediate: true })
watch(() => props.hiddenDangerData?.top3Types, (newVal) => {
refreshTop3TypesCharts(newVal)
}, { deep: true })
onMounted(() => {
// 组件挂载时,如果已有数据,立即更新图表
if (props.hiddenDangerData?.progress) {