fix: align yak recognition totals

V2.0
M先生 1 month ago
parent 01605804ff
commit 56d5662cab
  1. 2
      src/views/gdMap/livestockData.js
  2. 8
      src/views/yakManagement/data.js

@ -1,6 +1,6 @@
// Data mapped from cxph-jgpt real system screens and static data files. // Data mapped from cxph-jgpt real system screens and static data files.
export const YAK_STOCK_TOTAL = 458230; export const YAK_STOCK_TOTAL = 458230;
export const YAK_DRONE_RECOGNITION_TOTAL = 450230; export const YAK_DRONE_RECOGNITION_TOTAL = 450817;
export const YAK_EXPERT_CORRECTION = YAK_STOCK_TOTAL - YAK_DRONE_RECOGNITION_TOTAL; export const YAK_EXPERT_CORRECTION = YAK_STOCK_TOTAL - YAK_DRONE_RECOGNITION_TOTAL;
function scaleCountRowsToTotal(rows, total, key = "count") { function scaleCountRowsToTotal(rows, total, key = "count") {

@ -1,6 +1,8 @@
import { import {
townRecognitionRows, townRecognitionRows,
tradeImpactRows as baseTradeImpactRows, tradeImpactRows as baseTradeImpactRows,
YAK_DRONE_RECOGNITION_TOTAL,
YAK_EXPERT_CORRECTION,
YAK_STOCK_TOTAL, YAK_STOCK_TOTAL,
yakForecastRows, yakForecastRows,
} from "@/views/gdMap/livestockData" } from "@/views/gdMap/livestockData"
@ -10,8 +12,8 @@ export {
yakForecastRows, yakForecastRows,
} }
export const recognitionTotal = YAK_STOCK_TOTAL export const recognitionTotal = YAK_DRONE_RECOGNITION_TOTAL
export const expertCorrection = 0 export const expertCorrection = YAK_EXPERT_CORRECTION
export const tradeDeduction = 0 export const tradeDeduction = 0
export const estimatedStock = YAK_STOCK_TOTAL export const estimatedStock = YAK_STOCK_TOTAL
@ -132,7 +134,7 @@ export function getForecastStructureRows(period) {
} }
export function getTownForecastRows(period) { export function getTownForecastRows(period) {
const scale = period.stock / recognitionTotal const scale = period.stock / estimatedStock
const rows = townRows.map((item, index) => ({ const rows = townRows.map((item, index) => ({
...item, ...item,
forecast: Math.round(item.count * scale + (index % 3 - 1) * period.months * 18), forecast: Math.round(item.count * scale + (index % 3 - 1) * period.months * 18),

Loading…
Cancel
Save