chore(energy): 羚牛 tab 置前并默认选中(氢能/电能一致)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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:
@@ -6,7 +6,7 @@ import { fetchElectricMonthly } from './api';
|
|||||||
import type { CustomerType, ElectricMonthGroup } from './types';
|
import type { CustomerType, ElectricMonthGroup } from './types';
|
||||||
|
|
||||||
export default function ElectricDaily() {
|
export default function ElectricDaily() {
|
||||||
const [customer, setCustomer] = useState<CustomerType>('external');
|
const [customer, setCustomer] = useState<CustomerType>('lingniu');
|
||||||
const [months, setMonths] = useState<ElectricMonthGroup[] | null>(null);
|
const [months, setMonths] = useState<ElectricMonthGroup[] | null>(null);
|
||||||
const [openMonths, setOpenMonths] = useState<Set<string>>(new Set());
|
const [openMonths, setOpenMonths] = useState<Set<string>>(new Set());
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
@@ -35,7 +35,7 @@ export default function ElectricDaily() {
|
|||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{/* 客户类型 */}
|
{/* 客户类型 */}
|
||||||
<div className="bg-slate-100 rounded-xl p-1 grid grid-cols-2 gap-1">
|
<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
|
<button
|
||||||
key={c}
|
key={c}
|
||||||
onClick={() => setCustomer(c)}
|
onClick={() => setCustomer(c)}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const QUICK_PICK_OPTIONS: Array<{ id: DateQuickPick; label: string }> = [
|
|||||||
|
|
||||||
export default function HydrogenDaily() {
|
export default function HydrogenDaily() {
|
||||||
const [pick, setPick] = useState<DateQuickPick>('last30');
|
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 [expanded, setExpanded] = useState<Set<string>>(new Set());
|
||||||
const [rows, setRows] = useState<HydrogenDailyRow[] | null>(null);
|
const [rows, setRows] = useState<HydrogenDailyRow[] | null>(null);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
@@ -62,7 +62,7 @@ export default function HydrogenDaily() {
|
|||||||
|
|
||||||
{/* 客户类型 segmented */}
|
{/* 客户类型 segmented */}
|
||||||
<div className="bg-slate-100 rounded-xl p-1 grid grid-cols-2 gap-1">
|
<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
|
<button
|
||||||
key={c}
|
key={c}
|
||||||
onClick={() => setCustomer(c)}
|
onClick={() => setCustomer(c)}
|
||||||
|
|||||||
Reference in New Issue
Block a user