修改BUG

This commit is contained in:
wanggeng888 2021-03-15 21:55:10 +08:00
parent 53e7800fab
commit 4cb68bd4bd
3 changed files with 16 additions and 14 deletions

View File

@ -52,10 +52,12 @@ public class ChoiceBoxTableCellFactory implements Callback<TableColumn.CellDataF
if (StringUtils.equalsIgnoreCase(FormFieldTypeEnum.ID_SELECT.getValue(), fieldVO.getFormFieldType())) {
choiceBox.setItems(singleSelect);
} else {
fieldVO.setFormFieldValue(fieldVO.getFormFieldType());
choiceBox.setItems(normalSelect);
choiceBox.getSelectionModel().select(fieldVO.getFormFieldType());
if (StringUtils.isBlank(fieldVO.getFormFieldValue())) {
fieldVO.setFormFieldValue(fieldVO.getFormFieldType());
}
}
choiceBox.getSelectionModel().select(fieldVO.getFormFieldValue());
choiceBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
String oldText = (String) oldValue;
String newText = (String) newValue;

View File

@ -77,7 +77,7 @@
<select id="${field.propertyName}" name="${field.propertyName}">
<option value="">请选择${field.columnComment}</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
<option value="{{item.selectId}}">{{item.selectName}}</option>
{{# } }}
</select>
</script>
@ -88,7 +88,7 @@
<div class="layui-input-block layui-form" id="${field.propertyName}CheckboxTemplateBox" lay-filter="${field.propertyName}CheckboxTemplateBox"></div>
<script id="${field.propertyName}CheckboxTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="checkbox" name="${field.propertyName}[{{item.dictionaryId}}]" value="{{item.dictionaryId}}" title="{{item.dictionaryName}}">
<input type="checkbox" name="${field.propertyName}[{{item.selectId}}]" value="{{item.selectId}}" title="{{item.selectName}}">
{{# } }}
</script>
</div>
@ -98,7 +98,7 @@
<div class="layui-input-block layui-form" id="${field.propertyName}RadioTemplateBox" lay-filter="${field.propertyName}RadioTemplateBox"></div>
<script id="${field.propertyName}RadioTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="radio" name="${field.propertyName}" value="{{item.dictionaryId}}" title="{{item.dictionaryName}}">
<input type="radio" name="${field.propertyName}" value="{{item.selectId}}" title="{{item.selectName}}">
{{# } }}
</script>
</div>
@ -404,7 +404,7 @@
<#elseif field.formFieldValue == "select">
// 初始化${field.columnComment}下拉选择
function init${field.firstUpperPropertyName}Select() {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}SelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}SelectTemplateBox').innerHTML = html;
});
@ -417,7 +417,7 @@
<#elseif field.formFieldValue == "checkbox">
// 初始化${field.columnComment}复选
function init${field.firstUpperPropertyName}Checkbox() {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}CheckboxTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}CheckboxTemplateBox').innerHTML = html;
});
@ -430,7 +430,7 @@
<#elseif field.formFieldValue == "radio">
// 初始化${field.columnComment}单选
function init${field.firstUpperPropertyName}Radio() {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}RadioTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}RadioTemplateBox').innerHTML = html;
});

View File

@ -77,7 +77,7 @@
<select id="${field.propertyName}" name="${field.propertyName}">
<option value="">请选择${field.columnComment}</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
<option value="{{item.selectId}}">{{item.selectName}}</option>
{{# } }}
</select>
</script>
@ -88,7 +88,7 @@
<div class="layui-input-block layui-form" id="${field.propertyName}CheckboxTemplateBox" lay-filter="${field.propertyName}CheckboxTemplateBox"></div>
<script id="${field.propertyName}CheckboxTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="checkbox" name="${field.propertyName}[{{item.dictionaryId}}]" value="{{item.dictionaryId}}" title="{{item.dictionaryName}}">
<input type="checkbox" name="${field.propertyName}[{{item.selectId}}]" value="{{item.selectId}}" title="{{item.selectName}}">
{{# } }}
</script>
</div>
@ -98,7 +98,7 @@
<div class="layui-input-block" id="${field.propertyName}RadioTemplateBox" lay-filter="${field.propertyName}RadioTemplateBox"></div>
<script id="${field.propertyName}RadioTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="radio" name="${field.propertyName}" value="{{item.dictionaryId}}" title="{{item.dictionaryName}}">
<input type="radio" name="${field.propertyName}" value="{{item.selectId}}" title="{{item.selectName}}">
{{# } }}
</script>
</div>
@ -407,7 +407,7 @@
<#elseif field.formFieldValue == "select">
// 初始化${field.columnComment}下拉选择
function init${field.firstUpperPropertyName}Select(selectValue) {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}SelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}SelectTemplateBox').innerHTML = html;
});
@ -424,7 +424,7 @@
<#elseif field.formFieldValue == "checkbox">
// 初始化${field.columnComment}复选
function init${field.firstUpperPropertyName}Checkbox(selectValues) {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}CheckboxTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}CheckboxTemplateBox').innerHTML = html;
});
@ -444,7 +444,7 @@
<#elseif field.formFieldValue == "radio">
// 初始化${field.columnComment}单选
function init${field.firstUpperPropertyName}Radio(selectValue) {
top.restAjax.get(top.restAjax.path('api/url/${field.dictionaryId}', []), {}, null, function(code, data, args) {
top.restAjax.get(top.restAjax.path('api/url/selectUrl', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('${field.propertyName}RadioTemplate').innerHTML).render(data, function(html) {
document.getElementById('${field.propertyName}RadioTemplateBox').innerHTML = html;
});