chore(energy): 羚牛 tab 置前并默认选中(氢能/电能一致)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- HydrogenDaily/ElectricDaily 默认 customer 改为 'lingniu'
- segmented control 顺序改为 ['lingniu', 'external']
- 进入页面立刻看到我司数据,避免空状态首屏

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-29 18:53:22 +08:00
parent e2d04db06d
commit d8189329ac
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import { fetchElectricMonthly } from './api';
import type { CustomerType, ElectricMonthGroup } from './types';
export default function ElectricDaily() {
const [customer, setCustomer] = useState<CustomerType>('external');
const [customer, setCustomer] = useState<CustomerType>('lingniu');
const [months, setMonths] = useState<ElectricMonthGroup[] | null>(null);
const [openMonths, setOpenMonths] = useState<Set<string>>(new Set());
const [error, setError] = useState<string | null>(null);
@@ -35,7 +35,7 @@ export default function ElectricDaily() {
<div className="flex flex-col gap-3">
{/* 客户类型 */}
<div className="bg-slate-100 rounded-xl p-1 grid grid-cols-2 gap-1">
{(['external', 'lingniu'] as const).map(c => (
{(['lingniu', 'external'] as const).map(c => (
<button
key={c}
onClick={() => setCustomer(c)}

View File

@@ -17,7 +17,7 @@ const QUICK_PICK_OPTIONS: Array<{ id: DateQuickPick; label: string }> = [
export default function HydrogenDaily() {
const [pick, setPick] = useState<DateQuickPick>('last30');
const [customer, setCustomer] = useState<CustomerType>('external');
const [customer, setCustomer] = useState<CustomerType>('lingniu');
const [expanded, setExpanded] = useState<Set<string>>(new Set());
const [rows, setRows] = useState<HydrogenDailyRow[] | null>(null);
const [error, setError] = useState<string | null>(null);
@@ -62,7 +62,7 @@ export default function HydrogenDaily() {
{/* 客户类型 segmented */}
<div className="bg-slate-100 rounded-xl p-1 grid grid-cols-2 gap-1">
{(['external', 'lingniu'] as const).map(c => (
{(['lingniu', 'external'] as const).map(c => (
<button
key={c}
onClick={() => setCustomer(c)}