refactor(controller): 重构枚举类型相关代码,优化类型转换和显示逻辑
重构枚举类型的处理逻辑,统一使用Vo对象替代Model对象 - 修改ComboBoxUtils初始化逻辑,支持更多类型转换 - 实现VendorCatalogStringConverter用于类型转换 - 更新ContractFileTypeListCell和ContractFileTypeTableCell显示逻辑 - 调整VendorTabSkinFile和CompanyVendorTabSkinBase使用新的类型转换方式 - 更新相关服务类接口,添加类型转换方法 - 修改FXML文件添加类型选择控件
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
package com.ecep.contract.converter;
|
||||
|
||||
public class VendorCatalogStringConverter {
|
||||
import com.ecep.contract.service.VendorCatalogService;
|
||||
import com.ecep.contract.vo.VendorCatalogVo;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
public class VendorCatalogStringConverter extends StringConverter<VendorCatalogVo> {
|
||||
private final VendorCatalogService service;
|
||||
|
||||
public VendorCatalogStringConverter(VendorCatalogService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(VendorCatalogVo object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VendorCatalogVo fromString(String string) {
|
||||
return service.findByName(string);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user