| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?import javafx.geometry.*?>
- <?import javafx.scene.chart.*?>
- <?import javafx.scene.control.*?>
- <?import javafx.scene.layout.*?>
- <ScrollPane fx:id="statsPane" xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1" visible="false" managed="false" fitToWidth="true">
- <VBox spacing="16">
- <padding><Insets top="16" right="16" bottom="16" left="16"/></padding>
- <HBox spacing="10" alignment="CENTER_LEFT">
- <Label text="数据洞察" style="-fx-font-size: 18px; -fx-font-weight: bold;" HBox.hgrow="ALWAYS"/>
- <Button text="刷新数据" onAction="#handleLoadStatistics" styleClass="btn,btn-secondary"/>
- </HBox>
- <HBox spacing="16">
- <VBox styleClass="kpi-card" HBox.hgrow="ALWAYS">
- <Label text="交易总金额" styleClass="kpi-label"/>
- <Label fx:id="statTotalAmount" text="-" styleClass="kpi-value" style="-fx-text-fill: -fx-success;"/>
- </VBox>
- <VBox styleClass="kpi-card" HBox.hgrow="ALWAYS">
- <Label text="交易总笔数" styleClass="kpi-label"/>
- <Label fx:id="statTotalCount" text="-" styleClass="kpi-value"/>
- </VBox>
- </HBox>
- <VBox styleClass="well" spacing="12">
- <Label text="🔥 热门院系 TOP 3" style="-fx-font-size: 16px; -fx-font-weight: bold;"/>
- <SplitPane dividerPositions="0.65" prefHeight="220">
- <TableView fx:id="deptTable" minWidth="200">
- <columns>
- <TableColumn fx:id="deptRankCol" text="排名" prefWidth="60"/>
- <TableColumn fx:id="deptNameCol" text="院系" prefWidth="200"/>
- <TableColumn fx:id="deptSalesCol" text="销售额" prefWidth="150"/>
- </columns>
- </TableView>
- <PieChart fx:id="deptPieChart" minWidth="200" labelsVisible="true" legendVisible="false"/>
- </SplitPane>
- </VBox>
- <VBox styleClass="well" spacing="12">
- <Label text="📚 畅销书籍 TOP 5" style="-fx-font-size: 16px; -fx-font-weight: bold;"/>
- <SplitPane dividerPositions="0.65" prefHeight="220">
- <TableView fx:id="hotBookTable" minWidth="250">
- <columns>
- <TableColumn fx:id="hotBookRankCol" text="排名" prefWidth="60"/>
- <TableColumn fx:id="hotBookIdCol" text="编号" prefWidth="50"/>
- <TableColumn fx:id="hotBookTitleCol" text="书名" prefWidth="200"/>
- <TableColumn fx:id="hotBookAuthorCol" text="作者" prefWidth="120"/>
- <TableColumn fx:id="hotBookSoldCol" text="销量" prefWidth="80"/>
- </columns>
- </TableView>
- <BarChart fx:id="hotBookChart" minWidth="200" animated="false" legendVisible="false">
- <xAxis>
- <CategoryAxis side="BOTTOM" tickLabelRotation="-30"/>
- </xAxis>
- <yAxis>
- <NumberAxis side="LEFT" label="销量"/>
- </yAxis>
- </BarChart>
- </SplitPane>
- </VBox>
- <VBox styleClass="well" spacing="12">
- <Label text="📊 各院系平均折扣率" style="-fx-font-size: 16px; -fx-font-weight: bold;"/>
- <SplitPane dividerPositions="0.65" prefHeight="220">
- <TableView fx:id="discountTable" minWidth="250">
- <columns>
- <TableColumn fx:id="discountDeptCol" text="院系" prefWidth="200"/>
- <TableColumn fx:id="discountRateCol" text="平均折扣率" prefWidth="150"/>
- </columns>
- </TableView>
- <LineChart fx:id="discountChart" minWidth="200" animated="false" legendVisible="false" createSymbols="true">
- <xAxis>
- <CategoryAxis side="BOTTOM"/>
- </xAxis>
- <yAxis>
- <NumberAxis side="LEFT" label="折扣率(%)"/>
- </yAxis>
- </LineChart>
- </SplitPane>
- </VBox>
- </VBox>
- </ScrollPane>
|