This commit is contained in:
‘937886381’
2026-01-12 16:07:02 +08:00
parent b491f24126
commit babbe98c09
95 changed files with 286 additions and 259 deletions

View File

@@ -17,7 +17,7 @@ export default {
const vnodes = []
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
vnodes.push(<svg-icon icon-class={icon} />)
}
if (title) {

View File

@@ -1,19 +1,12 @@
<template>
<div :class="{ 'has-logo': showLogo }" :style="{
backgroundColor:
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}">
<div :class="{ 'has-logo': showLogo }"
:style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu :default-active="activeMenu" :collapse="isCollapse" :background-color="settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground
" :text-color="settings.sideTheme === 'theme-dark'
? variables.menuColor
: variables.menuLightColor
" :unique-opened="true" active-text-color="#fff" :collapse-transition="false" mode="vertical">
<el-menu :default-active="activeMenu" :collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:unique-opened="true" :active-text-color="settings.theme" :collapse-transition="false" mode="vertical">
<!-- 根据 sidebarRouters 路由生成菜单 -->
<sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route"
:base-path="route.path" />
@@ -23,16 +16,16 @@
</template>
<script>
import { mapGetters, mapState } from 'vuex';
import Logo from './Logo';
import SidebarItem from './SidebarItem';
import variables from '@/assets/styles/variables.scss';
import { mapGetters, mapState } from "vuex";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss";
export default {
components: { SidebarItem, Logo },
computed: {
...mapState(['settings']),
...mapGetters(['sidebarRouters', 'sidebar']),
...mapState(["settings"]),
...mapGetters(["sidebarRouters", "sidebar"]),
activeMenu() {
const route = this.$route;
const { meta, path } = route;
@@ -50,7 +43,7 @@ export default {
},
isCollapse() {
return !this.sidebar.opened;
},
},
}
}
};
</script>

View File

@@ -102,7 +102,15 @@ export default {
// 计算当月第一天00:00:00的时间戳
startTime = targetMoment.startOf('month').valueOf();
// 计算当月最后一天23:59:59的时间戳
endTime = targetMoment.endOf('month').valueOf();
endTime = targetMoment.clone()
.endOf('month')
.set({
hour: 23,
minute: 59,
second: 59,
millisecond: 0 // 毫秒设为0
})
.valueOf();
// 调试输出
console.log('月份时间范围计算结果:', {

View File

@@ -132,7 +132,15 @@ export default {
// 计算当月第一天00:00:00的时间戳
startTime = targetMoment.startOf('month').valueOf();
// 计算当月最后一天23:59:59的时间戳
endTime = targetMoment.endOf('month').valueOf();
endTime = targetMoment.clone()
.endOf('month')
.set({
hour: 23,
minute: 59,
second: 59,
millisecond: 0 // 毫秒设为0
})
.valueOf();
// 调试输出
console.log('月份时间范围计算结果:', {

View File

@@ -89,29 +89,42 @@ export default {
},
methods: {
// 解析rate字符串提取百分比数值
parseRateString(rateStr) {
if (!rateStr || typeof rateStr !== 'string') {
// 改进的 parseRateString 方法:能处理数字和字符串类型
parseRateString(rateValue) {
// 如果是 undefined 或 null返回默认值
if (rateValue === undefined || rateValue === null) {
return { displayText: '0%', progressValue: 0 };
}
// 尝试匹配百分比数字,如"减亏93%"中的93
const match = rateStr.match(/(\d+(\.\d+)?)%/);
if (match) {
const percentValue = parseFloat(match[1]);
// 如果是数字类型,直接处理
if (typeof rateValue === 'number') {
return {
displayText: rateStr, // 保持原字符串显示
progressValue: percentValue // 提取的百分比数值用于进度条
displayText: `${rateValue.toFixed(2)}%`,
progressValue: Math.min(Math.max(rateValue, 0), 100)
};
}
// 如果没有匹配到百分比,尝试解析纯数字
const numMatch = rateStr.match(/\d+(\.\d+)?/);
if (numMatch) {
const numValue = parseFloat(numMatch[0]);
return {
displayText: rateStr,
progressValue: numValue
};
// 如果是字符串类型,使用正则表达式处理
if (typeof rateValue === 'string') {
// 尝试匹配百分比数字,如"减亏93%"中的93
const match = rateValue.match(/(\d+(\.\d+)?)%/);
if (match) {
const percentValue = parseFloat(match[1]);
return {
displayText: rateValue,
progressValue: Math.min(Math.max(percentValue, 0), 100)
};
}
// 如果没有匹配到百分比,尝试解析纯数字
const numMatch = rateValue.match(/\d+(\.\d+)?/);
if (numMatch) {
const numValue = parseFloat(numMatch[0]);
return {
displayText: rateValue,
progressValue: Math.min(Math.max(numValue, 0), 100)
};
}
}
// 默认返回

View File

@@ -159,15 +159,15 @@ export default {
const currentDiff = diff[params.dataIndex] || 0;
const currentFlag = flags[params.dataIndex] || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -185,15 +185,15 @@ export default {
const currentDiff = diff[params.dataIndex] || 0;
const currentFlag = flags[params.dataIndex] || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -88,18 +88,18 @@ export default {
* @param {number} rate 处理后的rate值已*100
* @returns {0|1} flag值
*/
getRateFlag(rate, real, target) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
getRateFlag(rate, real, target) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 其他情况 => 未达标
return 0;
},
// 其他情况 => 未达标
return 0;
},
/**
* 核心处理函数:在所有数据都准备好后,才组装 chartData
*/

View File

@@ -84,16 +84,16 @@ export default {
* @returns {0|1} flag值
*/
getRateFlag(rate, real, target) {
// 先处理无效值的情况
if (isNaN(rate) || rate === null || rate === undefined) return 0;
console.log(rate, real, target)
// 实际值和目标值都为0时算作达标
if (real === 0 && target === 0 && rate === 0) {
return 1; // 达标
}
// 其他情况rate >= 100 或 rate === 0 时达标
return (rate >= 100) ? 1 : 0;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 其他情况 => 未达标
return 0;
},
/**
* 核心处理函数:在所有数据都准备好后,才组装 chartData

View File

@@ -118,14 +118,14 @@ export default {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = this.detailData?.flag || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -164,14 +164,14 @@ export default {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = data.flags[0] || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -163,14 +163,14 @@ getRateFlag(rate, real, target) {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = flagValue || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -196,15 +196,15 @@ export default {
const currentFlag = flags[params.dataIndex] || 0;
console.log('currentFlag', flags, params.dataIndex);
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -185,15 +185,15 @@ export default {
const currentDiff = diff[params.dataIndex] || 0;
const currentFlag = flags[params.dataIndex] || 0;
const prefix = currentFlag === 1 ? '+' : '-';
// const prefix = currentFlag === 1 ? '+' : '-';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -118,14 +118,14 @@ export default {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = this.detailData?.flag || 0;
const prefix = currentFlag === 1 ? '+' : '';
// const prefix = currentFlag === 1 ? '+' : '';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -164,14 +164,14 @@ export default {
// const flags = flags || [];
const currentDiff = diff || 0;
const currentFlag = flags[0] || 0;
const prefix = currentFlag === 1 ? '+' : '';
// const prefix = currentFlag === 1 ? '+' : '';
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -121,10 +121,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -163,10 +163,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -170,10 +170,10 @@ getRateFlag(rate, real, target) {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -170,10 +170,10 @@ getRateFlag(rate, real, target) {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -196,10 +196,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -119,10 +119,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -170,10 +170,10 @@ getRateFlag(rate, real, target) {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -163,10 +163,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -21,7 +21,7 @@
</div>
<div class="electricityGauge">
<!-- 传递包含flag的factoryData给仪表盘组件 -->
<electricityGauge id="month" :detailData="factoryData"></electricityGauge>
<electricityGauge id="year" :detailData="factoryData"></electricityGauge>
</div>
</div>
<div class="line" style="padding: 0px;">

View File

@@ -120,10 +120,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -198,10 +198,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -119,10 +119,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -160,10 +160,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -161,10 +161,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -160,10 +160,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -160,10 +160,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -159,10 +159,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -163,10 +163,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -159,10 +159,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -161,10 +161,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -160,10 +160,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -191,10 +191,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -127,10 +127,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -120,10 +120,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -162,10 +162,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -167,10 +167,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -170,10 +170,10 @@ getRateFlag(rate, real, target) {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -110,6 +110,8 @@ export default {
totalData: {},
trend: [],
relatedData: {},
relatedMon: {},
relatedTotal: {},
// cusProData: {},
};
},
@@ -199,11 +201,13 @@ export default {
getUnitPriceAnalysisBaseData(requestParams).then((res) => {
this.monData = res.data.monData
this.totalData = res.data.totalData
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedTotal: res.data.relatedTotal,
relatedMon: res.data.relatedMon,
}
this.relatedMon = res.data.relatedMon
this.relatedTotal = res.data.relatedTotal
// this.relatedData = {
// relatedTotal: res.data.relatedTotal,
// relatedMon: res.data.relatedMon,
// }
this.trend = res.data.trend
// this.relatedTotal = res.data.relatedTotal
// this.cusProData = {

View File

@@ -108,8 +108,10 @@ export default {
dateData: {},
monData: {},
totalData: {},
trend: [],
trend: {},
relatedData: {},
relatedMon: {},
relatedTotal: {},
// cusProData: {},
};
},
@@ -191,7 +193,7 @@ export default {
// index: this.index,
// sort: 1,
paramName: '产销率',
paramList: ['产量', '销量'],
paramList: ['产量(深加工)', '销量'],
baseId: this.factory,
// baseId: Number(this.factory),
};
@@ -200,10 +202,9 @@ export default {
this.monData = res.data.monData
this.totalData = res.data.totalData
// this.relatedMon = res.data.relatedMon
this.relatedData = {
relatedTotal: res.data.relatedTotal,
relatedMon: res.data.relatedMon,
}
this.relatedMon = res.data.relatedMon
this.relatedTotal = res.data.relatedTotal
this.trend = res.data.trend
// this.relatedTotal = res.data.relatedTotal
// this.cusProData = {

View File

@@ -200,10 +200,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -200,10 +200,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -63,8 +63,8 @@ export default {
return {
activeButton: 0,
isDropdownShow: false,
selectedProfit: '产量', // 关键修改:默认赋值为「净价」,初始化即展示该类目数据
profitOptions: ['产量', '销量']
selectedProfit: '产量(深加工)', // 关键修改:默认赋值为「净价」,初始化即展示该类目数据
profitOptions: ['产量(深加工)', '销量']
};
},
computed: {
@@ -200,10 +200,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -11,8 +11,8 @@
</div>
<div class="line">
<operatingSingleBar :detailData="{
...(relatedMon.产量 || defaultData),
flag: getRateFlag((relatedMon.产量 || defaultData).completeRate, (relatedMon.产量 || defaultData).real, (relatedMon.产量 || defaultData).target)
...(relatedMon['产量(深加工)'] || defaultData),
flag: getRateFlag((relatedMon['产量(深加工)'] || defaultData).completeRate, (relatedMon['产量(深加工)'] || defaultData).real, (relatedMon['产量(深加工)'] || defaultData).target)
}" />
</div>
</div>

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -119,10 +119,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -11,8 +11,8 @@
</div>
<div class="line">
<operatingSingleBar :detailData="{
...(relatedTotal.产量 || defaultData),
flag: getRateFlag((relatedTotal.产量 || defaultData).completeRate, (relatedTotal.产量 || defaultData).real, (relatedTotal.产量 || defaultData).target)
...(relatedTotal['产量(深加工)'] || defaultData),
flag: getRateFlag((relatedTotal['产量(深加工)'] || defaultData).completeRate, (relatedTotal['产量(深加工)'] || defaultData).real, (relatedTotal['产量(深加工)'] || defaultData).target)
}" />
</div>
</div>

View File

@@ -164,10 +164,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -122,10 +122,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -120,10 +120,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -197,7 +197,7 @@ export default {
// index: this.index,
// sort: 1,
paramName: '单价',
paramList: ['销量','成本','运费'],
paramList: ['销量','成本','运费'],
baseId:this.factory,
// baseId: Number(this.factory),
};

View File

@@ -11,7 +11,7 @@
<div class="chart-wrap">
<operatingSingleBar :detailData="{
...(relatedMon.销量 || defaultData),
flag: getRateFlag((relatedMon.销量 || defaultData).completeRate, (relatedMon.销量 || defaultData).real, (relatedMon.销量 || defaultData).target,)
flag: getRateFlag((relatedMon.销量 || defaultData).completeRate, (relatedMon.销量 || defaultData).real, (relatedMon.销量 || defaultData).target,)
}" />
</div>
</div>
@@ -22,8 +22,8 @@
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
...(relatedMon.成本 || defaultData),
flag: getRateFlag((relatedMon.成本 || defaultData).completeRate, (relatedMon.成本 || defaultData).real, (relatedMon.成本 || defaultData).target)
...(relatedMon.成本 || defaultData),
flag: getRateFlag((relatedMon.成本 || defaultData).completeRate, (relatedMon.成本 || defaultData).real, (relatedMon.成本 || defaultData).target)
}" />
</div>
</div>
@@ -36,7 +36,7 @@
<div class="chart-wrap">
<operatingSingleBar :detailData="{
...(relatedMon.运费 || defaultData),
flag: getRateFlag((relatedMon.运费 || defaultData).completeRate, (relatedMon.运费 || defaultData).real, (relatedMon.运费 || defaultData).target)
flag: getRateFlag((relatedMon.运费 || defaultData).completeRate, (relatedMon.运费 || defaultData).real, (relatedMon.运费 || defaultData).target)
}" />
</div>
</div>
@@ -63,7 +63,7 @@ export default {
},
dateData: {
type: Object,
default: () => ({ })
default: () => ({})
},
factory: {
type: [String, Number],
@@ -115,18 +115,18 @@ export default {
* @param {number} rate 完成率原始值如89代表89%
* @returns {0|1} flag值
*/
getRateFlag(rate, real, target) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
getRateFlag(rate, real, target) {
if (isNaN(rate) || rate === null || rate === undefined) return 0;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 1. 完成率 >= 100 => 达标
if (rate >= 100) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
if (rate === 0 && target === 0) return 1;
// 其他情况 => 未达标
return 0;
},
// 其他情况 => 未达标
return 0;
},
/**
* 图表更新方法:可在这里补充全局的图表刷新逻辑

View File

@@ -190,10 +190,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -125,10 +125,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -171,10 +171,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -158,10 +158,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -119,10 +119,10 @@ export default {
// 根据标志位选择不同的样式类
if (currentFlag === 1) {
// 达标 - 使用 rate-achieved 样式
return `{achieved|${prefix}${currentDiff}}{text|差值}`;
return `{achieved|${currentDiff}}{text|差值}`;
} else {
// 未达标 - 使用 rate-unachieved 样式
return `{unachieved|${prefix}${currentDiff}}{text|差值}`;
return `{unachieved|${currentDiff}}{text|差值}`;
}
},
backgroundColor: {

View File

@@ -22,8 +22,8 @@
</div>
<div class="chart-wrap">
<operatingSingleBar :detailData="{
...(relatedTotal.成本 || defaultData),
flag: getRateFlag((relatedTotal.成本 || defaultData).completeRate, (relatedTotal.成本 || defaultData).real, (relatedTotal.成本 || defaultData).target)
...(relatedTotal.成本 || defaultData),
flag: getRateFlag((relatedTotal.成本 || defaultData).completeRate, (relatedTotal.成本 || defaultData).real, (relatedTotal.成本 || defaultData).target)
}" />
</div>
</div>