1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
| app.layout = html.Div([ html.Div([ html.H1('📊 业务数据管理驾驶舱', style={'textAlign': 'center', 'color': '#2c3e50', 'padding': '20px'}), html.P('实时监控销售业绩与运营指标', style={'textAlign': 'center', 'color': '#7f8c8d', 'marginTop': '-10px'}) ], style={'backgroundColor': '#ecf0f1', 'marginBottom': '20px'}), html.Div([ html.Div([ html.Label('地区:', style={'fontWeight': 'bold'}), dcc.Dropdown( id='region-filter', options=[{'label': r, 'value': r} for r in regions], value='全部', clearable=False ) ], style={'width': '23%', 'display': 'inline-block', 'marginRight': '2%'}), html.Div([ html.Label('产品类别:', style={'fontWeight': 'bold'}), dcc.Dropdown( id='category-filter', options=[{'label': c, 'value': c} for c in categories], value='全部', clearable=False ) ], style={'width': '23%', 'display': 'inline-block', 'marginRight': '2%'}), html.Div([ html.Label('销售渠道:', style={'fontWeight': 'bold'}), dcc.Dropdown( id='channel-filter', options=[{'label': c, 'value': c} for c in channels], value='全部', clearable=False ) ], style={'width': '23%', 'display': 'inline-block', 'marginRight': '2%'}), html.Div([ html.Label('时间范围:', style={'fontWeight': 'bold'}), dcc.DatePickerRange( id='date-range', start_date=df['订单日期'].min(), end_date=df['订单日期'].max(), display_format='YYYY-MM-DD' ) ], style={'width': '25%', 'display': 'inline-block'}) ], style={'padding': '20px', 'backgroundColor': 'white', 'borderRadius': '10px', 'margin': '0 20px 20px 20px', 'boxShadow': '0 2px 4px rgba(0,0,0,0.1)'}), html.Div(id='kpi-cards', style={ 'display': 'flex', 'justifyContent': 'space-around', 'margin': '0 20px 20px 20px' }), html.Div([ html.Div([ dcc.Graph(id='trend-chart', style={'height': '400px'}) ], style={'width': '100%', 'marginBottom': '20px'}), html.Div([ html.Div([ dcc.Graph(id='category-chart', style={'height': '350px'}) ], style={'width': '48%', 'display': 'inline-block', 'marginRight': '4%'}), html.Div([ dcc.Graph(id='region-chart', style={'height': '350px'}) ], style={'width': '48%', 'display': 'inline-block'}) ]), html.Div([ html.Div([ dcc.Graph(id='channel-chart', style={'height': '350px'}) ], style={'width': '48%', 'display': 'inline-block', 'marginRight': '4%', 'marginTop': '20px'}), html.Div([ dcc.Graph(id='customer-chart', style={'height': '350px'}) ], style={'width': '48%', 'display': 'inline-block', 'marginTop': '20px'}) ]) ], style={'padding': '0 20px'}), html.Div([ html.H3('📋 详细数据', style={'marginTop': '30px'}), html.Div(id='data-table') ], style={'padding': '20px', 'margin': '20px', 'backgroundColor': 'white', 'borderRadius': '10px', 'boxShadow': '0 2px 4px rgba(0,0,0,0.1)'}), dcc.Interval(id='interval-component', interval=300*1000, n_intervals=0) ])
|