refactor(配置管理): 重构配置绑定组件结构并添加布尔类型支持

将原有配置绑定组件重构为泛型抽象基类,统一处理不同类型配置的绑定逻辑。新增BooleanConfig支持布尔类型配置,并优化了LocalDateTimeConfig的转换器处理。

重构后的AbstractConfigBounder提供通用属性绑定和变更处理,子类只需实现特定类型的双向绑定逻辑。同时调整了相关UI界面,添加了布尔配置开关控件。
This commit is contained in:
2025-08-28 15:09:54 +08:00
parent c69d3f1af2
commit c793c0925e
10 changed files with 238 additions and 127 deletions

View File

@@ -7,10 +7,10 @@
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import org.controlsfx.control.ToggleSwitch?>
<VBox prefHeight="400.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.manager.cloud.u8.YongYouU8ConfigWindowController">
<children>
<Label text="用友U8配置" />
<GridPane>
<columnConstraints>
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="50.0" prefWidth="250.0" />
@@ -19,21 +19,27 @@
</columnConstraints>
<rowConstraints>
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="同步时未创建公司开发日期在此之后的自动创建" />
<Label text="同步时公司未创建时, 公司开发日期在此之后的自动创建" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<DatePicker fx:id="auto_create_company_after" GridPane.columnIndex="2" />
<Label text="cloud.u8.contract.latestDate" GridPane.rowIndex="1" />
<TextField fx:id="contract_latest_date" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label text="cloud.u8.contract.latestId" GridPane.rowIndex="2" />
<TextField fx:id="contract_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="cloud.u8.sync.elapse" GridPane.rowIndex="3" />
<TextField fx:id="sync_elapse" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label text="cloud.u8.contract.latestDate" GridPane.rowIndex="4" />
<TextField fx:id="contract_latest_date" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<Label text="cloud.u8.contract.latestId" GridPane.rowIndex="5" />
<TextField fx:id="contract_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<Label text="cloud.u8.sync.elapse" GridPane.rowIndex="6" />
<TextField fx:id="sync_elapse" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label text="创建在此之后日期的公司" />
<ToggleSwitch fx:id="use_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="使用latestId同步" GridPane.rowIndex="2" />
<Label text="合同同步时是否使用最后更新的Id来判断更新范围否则使用最后更新的合同日期来判断更新范围" GridPane.columnIndex="2" GridPane.rowIndex="3" />
</children>
</GridPane>
</children>