| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <?xml version="1.0" encoding="UTF-8"?>
- <?import javafx.geometry.*?>
- <?import javafx.scene.control.*?>
- <?import javafx.scene.layout.*?>
- <BorderPane xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1" fx:controller="space.anyi.client.controller.MainController" prefWidth="1000" prefHeight="700">
- <top>
- <HBox alignment="CENTER_LEFT" spacing="10" style="-fx-background-color: #2c3e50; -fx-padding: 10 15;">
- <Label fx:id="welcomeLabel" text="欢迎" style="-fx-text-fill: white; -fx-font-size: 16px;" HBox.hgrow="ALWAYS"/>
- <Button text="退出登录" onAction="#handleLogout" style="-fx-background-color: #e74c3c; -fx-text-fill: white;"/>
- </HBox>
- </top>
- <center>
- <TabPane>
- <Tab text="浏览书籍" closable="false">
- <VBox spacing="10">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <HBox spacing="10">
- <TextField fx:id="searchField" promptText="搜索书名/作者..." HBox.hgrow="ALWAYS"/>
- <ComboBox fx:id="categoryCombo" prefWidth="150"/>
- <Button text="搜索" onAction="#handleSearch"/>
- </HBox>
- <SplitPane dividerPositions="0.6" VBox.vgrow="ALWAYS">
- <TableView fx:id="bookTable">
- <columns>
- <TableColumn fx:id="bookIdCol" text="编号" prefWidth="50"/>
- <TableColumn fx:id="titleCol" text="书名" prefWidth="200"/>
- <TableColumn fx:id="authorCol" text="作者" prefWidth="120"/>
- <TableColumn fx:id="categoryCol" text="分类" prefWidth="100"/>
- <TableColumn fx:id="priceCol" text="价格" prefWidth="80"/>
- <TableColumn fx:id="stockCol" text="库存" prefWidth="60"/>
- </columns>
- </TableView>
- <VBox spacing="10" alignment="TOP_CENTER">
- <padding><Insets top="10"/></padding>
- <Label text="书籍详情"
- style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
- <Label fx:id="detailTitle" text="-"/>
- <Label fx:id="detailAuthor" text="-"/>
- <Label fx:id="detailCategory" text="-"/>
- <Label fx:id="detailPrice" text="-"/>
- <Label fx:id="detailStock" text="-"/>
- <TextField fx:id="quantityField" promptText="数量" maxWidth="100"/>
- <Button text="购买" onAction="#handlePurchase" style="-fx-background-color: #27ae60; -fx-text-fill: white;"/>
- </VBox>
- </SplitPane>
- </VBox>
- </Tab>
- <Tab text="我的交易" closable="false">
- <VBox spacing="10">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <Button text="刷新" onAction="#handleLoadTransactions"/>
- <TableView fx:id="transTable" VBox.vgrow="ALWAYS">
- <columns>
- <TableColumn fx:id="transIdCol" text="交易编号" prefWidth="80"/>
- <TableColumn fx:id="transBookIdCol" text="书籍编号" prefWidth="80"/>
- <TableColumn fx:id="transNumCol" text="数量" prefWidth="80"/>
- <TableColumn fx:id="transPriceCol" text="总价" prefWidth="100"/>
- <TableColumn fx:id="transTimeCol" text="时间" prefWidth="200"/>
- </columns>
- </TableView>
- </VBox>
- </Tab>
- <Tab text="个人信息" closable="false">
- <VBox spacing="12" maxWidth="400">
- <padding><Insets top="20" right="20" bottom="20" left="20"/></padding>
- <Label text="个人信息"
- style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
- <HBox spacing="10"><Label text="用户名:" prefWidth="100"/><TextField fx:id="profileUsername" editable="false"/></HBox>
- <HBox spacing="10"><Label text="昵称:" prefWidth="100"/><TextField fx:id="profileNickname"/></HBox>
- <HBox spacing="10"><Label text="邮箱:" prefWidth="100"/><TextField fx:id="profileEmail"/></HBox>
- <HBox spacing="10"><Label text="电话:" prefWidth="100"/><TextField fx:id="profilePhone"/></HBox>
- <HBox spacing="10"><Label text="院系:" prefWidth="100"/><TextField fx:id="profileDept"/></HBox>
- <HBox spacing="10"><Label text="信用分:" prefWidth="100"/><Label fx:id="profileCredit"/></HBox>
- <Button text="保存修改" onAction="#handleUpdateProfile"/>
- </VBox>
- </Tab>
- <Tab fx:id="sellerTab" text="卖家中心" closable="false">
- <VBox spacing="10">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <Label text="我的书籍" style="-fx-font-weight: bold;"/>
- <Button text="刷新" onAction="#handleLoadMyBooks"/>
- <TableView fx:id="myBookTable" VBox.vgrow="ALWAYS">
- <columns>
- <TableColumn fx:id="myBookIdCol" text="编号" prefWidth="50"/>
- <TableColumn fx:id="myBookTitleCol" text="书名" prefWidth="250"/>
- <TableColumn fx:id="myBookPriceCol" text="价格" prefWidth="80"/>
- <TableColumn fx:id="myBookStockCol" text="库存" prefWidth="60"/>
- </columns>
- </TableView>
- <Button text="删除选中" onAction="#handleDeleteBook"/>
- <TitledPane text="添加新书" expanded="false">
- <GridPane hgap="10" vgap="8">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <Label text="书名" GridPane.rowIndex="0" GridPane.columnIndex="0"/><TextField fx:id="newTitle" GridPane.rowIndex="0" GridPane.columnIndex="1"/>
- <Label text="作者" GridPane.rowIndex="1" GridPane.columnIndex="0"/><TextField fx:id="newAuthor" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
- <Label text="分类" GridPane.rowIndex="2" GridPane.columnIndex="0"/><TextField fx:id="newCategory" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
- <Label text="原价" GridPane.rowIndex="3" GridPane.columnIndex="0"/><TextField fx:id="newOriginalPrice" GridPane.rowIndex="3" GridPane.columnIndex="1"/>
- <Label text="售价" GridPane.rowIndex="4" GridPane.columnIndex="0"/><TextField fx:id="newSellingPrice" GridPane.rowIndex="4" GridPane.columnIndex="1"/>
- <Label text="库存" GridPane.rowIndex="5" GridPane.columnIndex="0"/><TextField fx:id="newStock" GridPane.rowIndex="5" GridPane.columnIndex="1"/>
- <Button text="添加书籍" onAction="#handleAddBook" GridPane.rowIndex="6" GridPane.columnIndex="1"/>
- </GridPane>
- </TitledPane>
- </VBox>
- </Tab>
- <Tab text="数据统计" closable="false">
- <ScrollPane fitToWidth="true">
- <VBox spacing="15">
- <padding><Insets top="15" right="15" bottom="15" left="15"/></padding>
- <Button text="刷新数据" onAction="#handleLoadStatistics" maxWidth="200"/>
- <TitledPane text="总览" expanded="true">
- <HBox spacing="40">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <VBox spacing="5">
- <Label text="交易总金额" style="-fx-font-weight: bold;"/>
- <Label fx:id="statTotalAmount" text="-" style="-fx-font-size: 20px; -fx-text-fill: #27ae60;"/>
- </VBox>
- <VBox spacing="5">
- <Label text="交易总笔数" style="-fx-font-weight: bold;"/>
- <Label fx:id="statTotalCount" text="-" style="-fx-font-size: 20px;"/>
- </VBox>
- </HBox>
- </TitledPane>
- <TitledPane text="热门院系(销量前三)" expanded="true">
- <TableView fx:id="deptTable" prefHeight="150">
- <columns>
- <TableColumn fx:id="deptNameCol" text="院系" prefWidth="250"/>
- <TableColumn fx:id="deptSalesCol" text="销售额" prefWidth="200"/>
- </columns>
- </TableView>
- </TitledPane>
- <TitledPane text="热门书籍(前五)" expanded="true">
- <TableView fx:id="hotBookTable" prefHeight="150">
- <columns>
- <TableColumn fx:id="hotBookIdCol" text="编号" prefWidth="50"/>
- <TableColumn fx:id="hotBookTitleCol" text="书名" prefWidth="250"/>
- <TableColumn fx:id="hotBookAuthorCol" text="作者" prefWidth="120"/>
- <TableColumn fx:id="hotBookSoldCol" text="销量" prefWidth="80"/>
- </columns>
- </TableView>
- </TitledPane>
- <TitledPane text="各院系平均折扣率" expanded="true">
- <TableView fx:id="discountTable" prefHeight="150">
- <columns>
- <TableColumn fx:id="discountDeptCol" text="院系" prefWidth="250"/>
- <TableColumn fx:id="discountRateCol" text="平均折扣率" prefWidth="200"/>
- </columns>
- </TableView>
- </TitledPane>
- </VBox>
- </ScrollPane>
- </Tab>
- <Tab fx:id="adminTab" text="管理" closable="false">
- <VBox spacing="10">
- <padding><Insets top="10" right="10" bottom="10" left="10"/></padding>
- <Label text="用户管理"
- style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
- <Button text="刷新用户" onAction="#handleLoadAllUsers"/>
- <TableView fx:id="userTable" VBox.vgrow="ALWAYS">
- <columns>
- <TableColumn fx:id="userIdCol" text="编号" prefWidth="50"/>
- <TableColumn fx:id="userNameCol" text="用户名" prefWidth="120"/>
- <TableColumn fx:id="userNicknameCol" text="昵称" prefWidth="120"/>
- <TableColumn fx:id="userDeptCol" text="院系" prefWidth="150"/>
- <TableColumn fx:id="userCreditCol" text="信用分" prefWidth="60"/>
- <TableColumn fx:id="userRoleCol" text="角色" prefWidth="60"/>
- <TableColumn fx:id="userSellerCol" text="卖家" prefWidth="60"/>
- </columns>
- </TableView>
- <Button text="删除选中用户" onAction="#handleDeleteUser" style="-fx-background-color: #e74c3c; -fx-text-fill: white;"/>
- <Label text="全部交易" style="-fx-font-weight: bold; -fx-font-size: 16px;"/>
- <Button text="刷新交易" onAction="#handleLoadAllTransactions"/>
- <TableView fx:id="allTransTable" VBox.vgrow="ALWAYS">
- <columns>
- <TableColumn fx:id="allTransIdCol" text="交易编号" prefWidth="60"/>
- <TableColumn fx:id="allTransBookIdCol" text="书籍编号" prefWidth="60"/>
- <TableColumn fx:id="allTransBuyerIdCol" text="买家编号" prefWidth="60"/>
- <TableColumn fx:id="allTransNumCol" text="数量" prefWidth="40"/>
- <TableColumn fx:id="allTransPriceCol" text="价格" prefWidth="100"/>
- <TableColumn fx:id="allTransTimeCol" text="时间" prefWidth="200"/>
- </columns>
- </TableView>
- <Button text="删除选中交易" onAction="#handleDeleteTransaction" style="-fx-background-color: #e74c3c; -fx-text-fill: white;"/>
- </VBox>
- </Tab>
- </TabPane>
- </center>
- </BorderPane>
|