1、字典显示及优化

Former-commit-id: afe5037f8ac33e908b06180483a51f3e97121643
master
王兵 4 years ago
parent 0b1c6d5c62
commit 19b94f30bd

@ -53,6 +53,7 @@ import xyz.wbsite.dbtool.javafx.po.FieldType;
import xyz.wbsite.dbtool.javafx.po.Module;
import xyz.wbsite.dbtool.javafx.po.Project;
import xyz.wbsite.dbtool.javafx.po.Table;
import xyz.wbsite.dbtool.javafx.tool.Dialog;
import xyz.wbsite.dbtool.javafx.tool.Tool;
import xyz.wbsite.dbtool.javafx.view.DBCheckBoxTableCell;
import xyz.wbsite.dbtool.web.frame.utils.ResourceUtil;
@ -140,46 +141,76 @@ public class JavaFxApplication extends Application {
}
});
ContextMenu con = new ContextMenu(new MenuItem("新增"), new MenuItem("删除"), new MenuItem("向上调整"), new MenuItem("向下调整"));
con.setOnAction(new EventHandler<ActionEvent>() {
mFields.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(ActionEvent event) {
MenuItem target = (MenuItem) event.getTarget();
int index = mFields.getSelectionModel().getSelectedIndex();
List<Field> fields = currentTable.getFields();
if ("新增".equals(target.getText())) {
addField();
public void handle(MouseEvent event) {
int selectedIndex = mFields.getSelectionModel().getSelectedIndex();
if (currentTable== null){
return;
}
Field field = currentTable.getFields().get(selectedIndex);
ContextMenu con = null;
if (field.getFieldType().name().equals(FieldType.Dict.name())){
con = new ContextMenu(
new MenuItem("新增"),
new MenuItem("删除"),
new MenuItem("编辑字典"),
new MenuItem("向上调整"),
new MenuItem("向下调整"));
}else {
con = new ContextMenu(
new MenuItem("新增"),
new MenuItem("删除"),
new MenuItem("向上调整"),
new MenuItem("向下调整"));
}
if (index != -1) {
switch (target.getText()) {
case "删除":
subField();
break;
case "向上调整":
if (index > 0) {
fields.add(index - 1, fields.get(index));
fields.add(index + 1, fields.get(index));
fields.remove(index);
fields.remove(index + 1);
}
break;
case "向下调整":
if (index < fields.size() - 1) {
fields.add(index, fields.get(index + 1));
fields.add(index + 2, fields.get(index + 1));
fields.remove(index + 1);
fields.remove(index + 2);
con.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
MenuItem target = (MenuItem) event.getTarget();
int index = mFields.getSelectionModel().getSelectedIndex();
List<Field> fields = currentTable.getFields();
if ("新增".equals(target.getText())) {
addField();
}
if (index != -1) {
switch (target.getText()) {
case "删除":
subField();
break;
case "向上调整":
if (index > 0) {
fields.add(index - 1, fields.get(index));
fields.add(index + 1, fields.get(index));
fields.remove(index);
fields.remove(index + 1);
}
break;
case "向下调整":
if (index < fields.size() - 1) {
fields.add(index, fields.get(index + 1));
fields.add(index + 2, fields.get(index + 1));
fields.remove(index + 1);
fields.remove(index + 2);
}
break;
case "编辑字典":
Field field = fields.get(index);
Dialog.showDictEdit(field);
break;
}
break;
loadTable();
JavaFxApplication.this.mFields.getSelectionModel().clearSelection();
}
}
loadTable();
JavaFxApplication.this.mFields.getSelectionModel().clearSelection();
}
});
mFields.setContextMenu(con);
}
});
mFields.setContextMenu(con);
project_menu = new ContextMenu(new MenuItem("新增模块"));
md_right_menu = new ContextMenu(new MenuItem("新增对象"), new MenuItem("删除模块"), new MenuItem("向上调整"), new MenuItem("向下调整"));

@ -212,7 +212,6 @@ public class MainController {
Dialog.showDoc();
}
@FXML
public void generateAndroid(ActionEvent actionEvent) {
Dialog.showAndroid();

@ -0,0 +1,174 @@
package xyz.wbsite.dbtool.javafx.ctrl;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.control.cell.TextFieldTableCell;
import javafx.util.Callback;
import javafx.util.converter.DefaultStringConverter;
import xyz.wbsite.dbtool.javafx.po.DictItem;
import java.util.ArrayList;
import java.util.List;
public class OptionDictController {
@FXML
private Button start;
@FXML
private Button cancel;
@FXML
private TableView dictItems;
@FXML
private Button add;
@FXML
private Button sub;
private List<DictItem> data = new ArrayList<>();
public List<DictItem> getData() {
return data;
}
public void setData(List<DictItem> data) {
this.data = data;
}
public Button getStart() {
return start;
}
public void setStart(Button start) {
this.start = start;
}
public Button getCancel() {
return cancel;
}
public void setCancel(Button cancel) {
this.cancel = cancel;
}
public TableView getDictItems() {
return dictItems;
}
public void setDictItems(TableView dictItems) {
this.dictItems = dictItems;
}
public Button getAdd() {
return add;
}
public void setAdd(Button add) {
this.add = add;
}
public Button getSub() {
return sub;
}
public void setSub(Button sub) {
this.sub = sub;
}
public void initData() {
dictItems.setEditable(true);
dictItems.setSortPolicy(new Callback<TableView, Boolean>() {
@Override
public Boolean call(TableView param) {
//禁止点击列头排序
return false;
}
});
ObservableList<TableColumn> columns = dictItems.getColumns();
columns.get(0).setCellValueFactory(new PropertyValueFactory("key"));
columns.get(0).setCellFactory(new Callback<TableColumn, TableCell>() {
@Override
public TableCell call(TableColumn param) {
param.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent>() {
@Override
public void handle(TableColumn.CellEditEvent event) {
int row = event.getTablePosition().getRow();
DictItem field = data.get(row);
field.setKey((String) event.getNewValue());
}
});
return new TextFieldTableCell(new DefaultStringConverter()) {
@Override
public void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
int index = this.getTableRow().getIndex();
}
};
}
});
columns.get(1).setCellValueFactory(new PropertyValueFactory("value"));
columns.get(1).setCellFactory(new Callback<TableColumn, TableCell>() {
@Override
public TableCell call(TableColumn param) {
param.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent>() {
@Override
public void handle(TableColumn.CellEditEvent event) {
int row = event.getTablePosition().getRow();
DictItem field = data.get(row);
field.setValue((String) event.getNewValue());
}
});
return new TextFieldTableCell(new DefaultStringConverter()) {
@Override
public void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
int index = this.getTableRow().getIndex();
}
};
}
});
ObservableList<DictItem> ObservableList = FXCollections.observableArrayList();
ObservableList.addAll(data);
dictItems.setItems(ObservableList);
}
public void refresh(){
ObservableList<DictItem> ObservableList = FXCollections.observableArrayList();
ObservableList.addAll(data);
dictItems.setItems(ObservableList);
}
public DictItem getNewDictItem() {
String baseKey = "KEY";
String baseValue = "VALUE";
String key = baseKey;
String value = baseValue;
int k = 0;
do {
int i;
for (i = 0; i < data.size(); i++) {
if (key.equals(data.get(i).getKey())) {
break;
}
}
if (i < data.size()) {
k++;
key = baseKey + k;
value = baseValue + k;
} else {
DictItem dictItem = new DictItem();
dictItem.setKey(key);
dictItem.setValue(value);
return dictItem;
}
} while (true);
}
}

@ -5,8 +5,9 @@ import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import xyz.wbsite.dbtool.javafx.annotation.Property;
import xyz.wbsite.dbtool.javafx.po.DataBase;
import xyz.wbsite.dbtool.javafx.po.FieldType;
import xyz.wbsite.dbtool.javafx.po.DictItem;
import xyz.wbsite.dbtool.javafx.po.Field;
import xyz.wbsite.dbtool.javafx.po.FieldType;
import xyz.wbsite.dbtool.javafx.po.Module;
import xyz.wbsite.dbtool.javafx.po.Project;
import xyz.wbsite.dbtool.javafx.po.Table;
@ -121,6 +122,15 @@ public class XmlManager {
field.setIsQuery(getBoolean(fieldElement.getAttribute("isQuery")));
field.setIsSearch(getBoolean(fieldElement.getAttribute("isSearch")));
table.putField(field);
NodeList dictItems = fieldElement.getElementsByTagName("dictItem");
for (int l = 0; l < dictItems.getLength(); l++) {
Element di = (Element) dictItems.item(l);
DictItem dictItem = new DictItem();
dictItem.setKey(di.getAttribute("key"));
dictItem.setValue(di.getAttribute("value"));
field.getDictItems().add(dictItem);
}
}
}
table.setdBhandle(module);
@ -251,6 +261,15 @@ public class XmlManager {
if (f.getIsSystem() != null) {
field.setAttribute("IsSystem", f.getIsSystem().toString());
}
if (f.getDictItems().size() > 0) {
for (DictItem dictItem : f.getDictItems()) {
Element dict = doc.createElement("dictItem");
dict.setAttribute("key", dictItem.getKey());
dict.setAttribute("value", dictItem.getValue());
field.appendChild(dict);
}
}
fields.appendChild(field);
}
tables.appendChild(table);

@ -0,0 +1,24 @@
package xyz.wbsite.dbtool.javafx.po;
public class DictItem {
private String key;
private String value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -3,6 +3,8 @@ package xyz.wbsite.dbtool.javafx.po;
import org.springframework.util.StringUtils;
import xyz.wbsite.dbtool.javafx.tool.Tool;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -53,11 +55,20 @@ public class Field extends Table {
*/
private Boolean isQuery = false;
private Boolean isSearch = false;
private Boolean isSystem = false;
private List<DictItem> dictItems = new ArrayList<>();
public List<DictItem> getDictItems() {
return dictItems;
}
public void setDictItems(List<DictItem> dictItems) {
this.dictItems = dictItems;
}
public String getTestValue() {
String value = "";
if (fieldType.name().matches("String_\\d+")) {

@ -12,21 +12,41 @@ import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.stage.DirectoryChooser;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import xyz.wbsite.dbtool.Application;
import xyz.wbsite.dbtool.javafx.ctrl.*;
import xyz.wbsite.dbtool.javafx.ctrl.ConnectInfoController;
import xyz.wbsite.dbtool.javafx.ctrl.OptionAndroidController;
import xyz.wbsite.dbtool.javafx.ctrl.OptionApiController;
import xyz.wbsite.dbtool.javafx.ctrl.OptionDictController;
import xyz.wbsite.dbtool.javafx.ctrl.OptionDocController;
import xyz.wbsite.dbtool.javafx.ctrl.OptionVueController;
import xyz.wbsite.dbtool.javafx.manger.ManagerFactory;
import xyz.wbsite.dbtool.javafx.manger.ProjectManager;
import xyz.wbsite.dbtool.javafx.po.*;
import xyz.wbsite.dbtool.javafx.po.AndroidOption;
import xyz.wbsite.dbtool.javafx.po.Api;
import xyz.wbsite.dbtool.javafx.po.DictItem;
import xyz.wbsite.dbtool.javafx.po.Field;
import xyz.wbsite.dbtool.javafx.po.Module;
import xyz.wbsite.dbtool.javafx.po.VueOption;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
@ -336,7 +356,7 @@ public class Dialog {
Stage stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/apiOption.fxml"));
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/OptionApi.fxml"));
try {
dbdetailloader.load();
Parent root = dbdetailloader.getRoot();
@ -482,7 +502,7 @@ public class Dialog {
if (new File(module).exists()) {
Dialog.showProgress("生成中...");
dBmanger.generateApi(new File(module), new File(api),controller.getDomainList(), controller.getData());
dBmanger.generateApi(new File(module), new File(api), controller.getDomainList(), controller.getData());
Dialog.stopPopup();
Platform.runLater(new Runnable() {
@Override
@ -645,8 +665,77 @@ public class Dialog {
}
}
public static void showDictEdit(Field field) {
Stage stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/OptionDict.fxml"));
try {
dbdetailloader.load();
Parent root = dbdetailloader.getRoot();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("编辑字典项");
OptionDictController controller = dbdetailloader.getController();
controller.setData(field.getDictItems());
Button add = controller.getAdd();
add.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
DictItem newDictItem = controller.getNewDictItem();
controller.getData().add(newDictItem);
controller.refresh();
}
});
Button sub = controller.getSub();
sub.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
int selectedIndex = controller.getDictItems().getSelectionModel().getSelectedIndex();
if (selectedIndex > -1) {
controller.getData().remove(selectedIndex);
controller.getDictItems().getSelectionModel().clearSelection();
controller.refresh();
}
}
});
Button start = controller.getStart();
start.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Dialog.stopPopup();
Platform.runLater(new Runnable() {
@Override
public void run() {
stage.close();
}
});
}
});
Button cancel = controller.getCancel();
cancel.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
stage.close();
}
});
controller.initData();
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void showAndroid() {
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/androidOption.fxml"));
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/OptionAndroid.fxml"));
try {
dbdetailloader.load();
} catch (IOException e) {
@ -704,7 +793,7 @@ public class Dialog {
}
public static void showVue() {
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/vueOption.fxml"));
FXMLLoader dbdetailloader = new FXMLLoader(Application.class.getResource("../../../fxml/OptionVue.fxml"));
try {
dbdetailloader.load();
} catch (IOException e) {

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane fx:controller="xyz.wbsite.dbtool.javafx.ctrl.OptionDictController"
maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
minWidth="-Infinity" prefHeight="200.0" prefWidth="300.0"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<top>
<ToolBar prefHeight="30.0" prefWidth="300.0" BorderPane.alignment="CENTER">
<items>
<Button fx:id="add" mnemonicParsing="false" text=" + "/>
<Button fx:id="sub" mnemonicParsing="false" text=" - "/>
</items>
</ToolBar>
</top>
<opaqueInsets>
<Insets/>
</opaqueInsets>
<BorderPane.margin>
<Insets top="20.0"/>
</BorderPane.margin>
<center>
<TableView fx:id="dictItems" prefHeight="170.0" prefWidth="300.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn prefWidth="100.0" text="字典键"/>
<TableColumn prefWidth="198.0" text="字典值"/>
</columns>
</TableView>
</center>
<bottom>
<GridPane prefHeight="45.0" prefWidth="300.0" BorderPane.alignment="CENTER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="80.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="80.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Button fx:id="start" mnemonicParsing="false" text="确认" GridPane.halignment="CENTER"
GridPane.valignment="CENTER"/>
<Button fx:id="cancel" mnemonicParsing="false" text="取消" GridPane.columnIndex="1"
GridPane.halignment="CENTER"
GridPane.valignment="CENTER"/>
</children>
</GridPane>
</bottom>
</BorderPane>

@ -1,40 +0,0 @@
package ${basePackage}.frame.schedule;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import ${basePackage}.frame.auth.LocalData;
import ${basePackage}.frame.utils.LogUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public abstract class RunSqlTask extends RunFixRepeatTask {
private Connection connection;
@Override
public void run() {
try {
if (connection == null || connection.isClosed()) {
SqlSessionFactory factory = LocalData.getBean(SqlSessionFactory.class);
SqlSession sqlSession = factory.openSession(true);
connection = sqlSession.getConnection();
}
} catch (Exception e) {
e.printStackTrace();
LogUtil.e("schedule: get connection failed!");
return;
}
try {
PreparedStatement preparedStatement = connection.prepareStatement(getSql());
preparedStatement.execute();
preparedStatement.close();
} catch (SQLException e) {
e.printStackTrace();
LogUtil.e("RunSqlTask exec failed! SQL:[" + getSql() + "]");
}
}
public abstract String getSql();
}

@ -10,6 +10,10 @@ public abstract class RunTask implements Runnable {
public abstract String taskId();
public String taskName(){
return "";
}
public abstract ScheduledFuture<?> schedule(ThreadPoolTaskScheduler poolTaskScheduler);
public void configChange(ThreadPoolTaskScheduler scheduler) {

@ -23,7 +23,7 @@ public class DictItemCreateRequest extends BaseRequest {
/**
*
*/
@Length(min = 1, max = 10, message = "[key]字典键长度不合法(1-10)")
@Length(min = 1, max = 20, message = "[key]字典键长度不合法(1-20)")
private String key;
/**

@ -278,6 +278,7 @@
}
Vue.config.productionTip = false;
Vue.prototype.$dictMap = {};
var mixin = {
data: {
activeIndex: 'home',
@ -649,6 +650,7 @@
Vue.component('el-input-dict', {
data: function () {
return {
item: {},
options: []
}
},
@ -689,6 +691,7 @@
},
methods: {
input: function (item) {
this.item = item;
switch (this.valueFor) {
case "key":
this.$emit('input', item.key);
@ -701,28 +704,96 @@
break;
}
},
},
created: function () {
if (this.dictName) {
new Ajax("system", "dict").method("load").post({
dictName: this.dictName
},function (response) {
if (response.errors.length > 0) {
console.error(response.errors[0].message)
init: function () {
if (this.dictName) {
var dictItems = Vue.prototype.$dictMap[this.dictName];
if (typeof(dictItems) === "undefined") {
new Ajax("system", "dict", "load").post({
dictName: this.dictName
}, function (response) {
if (response.errors.length > 0) {
console.error(response.errors[0].message)
} else {
Vue.prototype.$dictMap[this.dictName] = response.dictItems;
}
}.bind(this));
Vue.prototype.$dictMap[this.dictName] = [];
this.init();
} else if (dictItems.length === 0) {
setTimeout(function () {
this.init()
}.bind(this), 100);
} else {
this.options = response.dictItems;
this.options = dictItems;
}
}.bind(this));
}
}
},
created: function () {
this.init();
},
template: '' +
'<el-select :value="value" @input="input" filterable clearable placeholder="请选择" :size="size" :placeholder="placeholder" @change="change">' +
'<el-select :value="item.value" @input="input" filterable clearable placeholder="请选择" :size="size" :placeholder="placeholder" @change="change">' +
' <el-option v-for="item in options" :key="item.key" :label="item.value" :value="item">' +
' <span style="float: left">{{ item.value }}</span>' +
' <span style="float: right; color: #8492a6; font-size: 12px">{{ item.key }}</span>' +
' </el-option>' +
'</el-select>'
});
//字典组件
Vue.component('el-view-dict', {
data: function () {
return {
item: {},
}
},
props: {
value: {
type: String,
default: ''
},
dictName: {
type: String,
default: ''
},
},
methods: {
init: function () {
if (this.dictName) {
var dictItems = Vue.prototype.$dictMap[this.dictName];
if (typeof(dictItems) === "undefined") {
new Ajax("system", "dict", "load").post({
dictName: this.dictName
}, function (response) {
if (response.errors.length > 0) {
console.error(response.errors[0].message)
} else {
Vue.prototype.$dictMap[this.dictName] = response.dictItems;
}
}.bind(this));
Vue.prototype.$dictMap[this.dictName] = [];
this.init();
} else if (dictItems.length === 0) {
setTimeout(function () {
this.init()
}.bind(this), 100);
} else {
this.options = dictItems;
for (var i = 0; i < this.options.length; i++) {
if (this.options[i].key == this.value) {
this.item = this.options[i];
}
}
}
}
}
},
created: function () {
this.init();
},
template: '' +
'<span>{{item.value}}</span>'
});
//机构选择
Vue.component('el-input-dept', {
data: function () {

@ -120,17 +120,70 @@
</el-table-column>
<#list fields as item>
<#if !item.isSystem>
<#if item.fieldType == 'Boolean'>
<el-table-column
align="center"
prop="${item.getFName()}"
<#if item.fieldType.javaType() == 'Date'>
label="${item.fieldComment?default("")}">
<template slot-scope="scope">
<span v-if="scope.row.${item.getFName()}">是</span>
<span v-if="!scope.row.${item.getFName()}">否</span>
</template>
</el-table-column>
<#elseif item.fieldType == 'Date'>
<el-table-column
align="center"
width="140"
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
<#elseif item.fieldType == 'Dict'>
<el-table-column
align="center"
width="100"
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
<template slot-scope="scope">
<el-view-dict v-model="scope.row.${item.getFName()}" dict-name="${item.fieldName}"></el-view-dict>
</template>
</el-table-column>
<#elseif item.fieldType == 'String_1' || item.fieldType == 'String_10'|| item.fieldType == 'String_var'>
<el-table-column
align="center"
width="100"
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
<#elseif item.fieldType == 'String_var50' || item.fieldType == 'String_var100'|| item.fieldType == 'String_var255'>
<el-table-column
align="center"
width="140"
<#elseif item.fieldType.javaType() == 'Long'>
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
<#elseif item.fieldType == 'String_var500' || item.fieldType == 'String_var2500'|| item.fieldType == 'String_var4000'|| item.fieldType == 'String_super'>
<el-table-column
align="center"
width="240"
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
<#elseif item.fieldType == 'Long'>
<el-table-column
align="center"
width="140"
</#if>
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
<#else>
<el-table-column
align="center"
width="100"
prop="${item.getFName()}"
label="${item.fieldComment?default("")}">
</el-table-column>
</#if>
</#if>
</#list>
<el-table-column
align="center"

@ -104,6 +104,21 @@ public class DataInit {
{"IMG", "图片"},
});
}
<#list project.modules as module>
<#list module.tables as table>
<#list table.fields as field>
<#if field.fieldType == 'Dict'>
{// ${field.fieldComment}
createDict("${field.fieldName}", "${field.fieldComment}", new String[][]{
<#list field.dictItems as dictItem>
{"${dictItem.key}", "${dictItem.value}"},
</#list>
});
}
</#if>
</#list>
</#list>
</#list>
}
//endregion

Loading…
Cancel
Save

Powered by TurnKey Linux.