| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.code.BaseGenerator; |
| | | import com.java110.code.back.BaseGenerator; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | public class GeneratorEditComponent extends BaseGenerator { |
| | |
| | | JSONArray columns = data.getJSONArray("columns"); |
| | | for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) { |
| | | JSONObject column = columns.getJSONObject(columnIndex); |
| | | if (column.getBoolean("hasDefaultValue")) { |
| | | if ("none".equals(column.getString("inputType"))) { |
| | | continue; |
| | | } |
| | | String required = column.getBoolean("required") ? "必填" : "选填"; |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/component/edit-" + data.getString("templateCode") + "/edit" + toUpperCaseFirstOne(data.getString("templateCode")) + ".html"; |
| | | + "out/web/component/"+data.getString("templateCode")+"Package/edit-" + data.getString("templateCode") + "/edit" + toUpperCaseFirstOne(data.getString("templateCode")) + ".html"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/component/edit-" + data.getString("templateCode") + "/edit" + toUpperCaseFirstOne(data.getString("templateCode")) + ".js"; |
| | | + "out/web/component/"+data.getString("templateCode")+"Package/edit-" + data.getString("templateCode") + "/edit" + toUpperCaseFirstOne(data.getString("templateCode")) + ".js"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |