| | |
| | | private String createFormEditColumns() { |
| | | StringBuilder sb = new StringBuilder(); |
| | | int times = 0; |
| | | boolean has = false;boolean init = false; |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey() |
| | | || column.getHumpName().equals("deleted") |
| | | || column.getHumpName().equals("hostId") |
| | | || column.getHumpName().equals("memo") |
| | | ) { |
| | | continue; |
| | | } |
| | | if (times%2 == 0) { |
| | | sb.append(" <ProForm.Group>\n"); |
| | | has = true;init=true; |
| | | } |
| | | |
| | | String itemType = "ProFormText"; |
| | |
| | | |
| | | // 关联表 |
| | | if (!Cools.isEmpty(column.getForeignKey())) { |
| | | sb.append(" showSearch\n") |
| | | .append(" debounceTime={300}\n") |
| | | .append(" request={async ({ keyWords }) => {\n") |
| | | .append(" const resp = await Http.doPostForm('api/").append(GeneratorUtils.firstCharConvert(column.getForeignKey())).append("/query', { condition: keyWords });\n") |
| | | .append(" }}\n"); |
| | | sb.append(" showSearch\n") |
| | | .append(" debounceTime={300}\n") |
| | | .append(" request={async ({ keyWords }) => {\n") |
| | | .append(" const resp = await Http.doPostForm('api/").append(GeneratorUtils.firstCharConvert(column.getForeignKey())).append("/query', { condition: keyWords });\n") |
| | | .append(" }}\n"); |
| | | } |
| | | |
| | | sb.append(" />\n"); |
| | | sb.append(" />\n"); |
| | | |
| | | if (times%2 == 0) { |
| | | if (times%2 != 0) { |
| | | sb.append(" </ProForm.Group>\n"); |
| | | has = false; |
| | | } |
| | | times++; |
| | | } |
| | | if (init && has) { |
| | | sb.append(" </ProForm.Group>\n"); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | |
| | | -- save @{SIMPLEENTITYNAME} record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `type`, `sort`, `host_id`, `status`) values ( '@{SIMPLEENTITYNAME}管理', '0', '/@{TABLEDESC}/@{SIMPLEENTITYNAME}', '0' , '0', '1' , '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `type`, `sort`, `host_id`, `status`) values ( '@{TABLEDESC}管理', '0', '/@{ITEMNAME}/@{SIMPLEENTITYNAME}', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '查询@{TABLEDESC}', '', '1', '@{ITEMNAME}:@{SIMPLEENTITYNAME}:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '添加@{TABLEDESC}', '', '1', '@{ITEMNAME}:@{SIMPLEENTITYNAME}:save', '1', '1', '1'); |