<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>

<VBox spacing="10" xmlns:fx="http://javafx.com/fxml"
      fx:controller="com.zhangmeng.online.exam.ui.controller.UserEditController">
    <padding>
        <Insets top="10" right="10" bottom="10" left="10"/>
    </padding>

    <GridPane hgap="10" vgap="10">
        <columnConstraints>
            <ColumnConstraints minWidth="80" prefWidth="100"/>
            <ColumnConstraints hgrow="ALWAYS"/>
        </columnConstraints>

        <!-- 用户名 -->
        <Label text="用户名:" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
        <TextField fx:id="usernameField" GridPane.rowIndex="0" GridPane.columnIndex="1"/>

        <!-- 姓名 -->
        <Label text="姓名:" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
        <TextField fx:id="nameField" GridPane.rowIndex="1" GridPane.columnIndex="1"/>

        <!-- 密码 -->
        <Label text="密码:" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
        <PasswordField fx:id="passwordField" GridPane.rowIndex="2" GridPane.columnIndex="1"/>

        <!-- 邮箱 -->
        <Label text="邮箱:" GridPane.rowIndex="3" GridPane.columnIndex="0"/>
        <TextField fx:id="emailField" GridPane.rowIndex="3" GridPane.columnIndex="1"/>

        <!-- 状态 -->
        <Label text="状态:" GridPane.rowIndex="4" GridPane.columnIndex="0"/>
        <ComboBox fx:id="statusComboBox" GridPane.rowIndex="4" GridPane.columnIndex="1"/>

        <!-- 角色 -->
        <Label text="角色:" GridPane.rowIndex="5" GridPane.columnIndex="0"/>
        <ListView fx:id="roleListView" prefHeight="100" GridPane.rowIndex="5" GridPane.columnIndex="1"/>
    </GridPane>

    <HBox spacing="10" alignment="CENTER_RIGHT">
        <Button text="保存" onAction="#handleSave" defaultButton="true"/>
        <Button text="取消" onAction="#handleCancel" cancelButton="true"/>
    </HBox>
</VBox> 