Browse Source

【优化】生成代码后加入权限控制接口、修复代码生成点击配置部分内容被重置问题、生成的表单数字输入框值改为10000,滑动输入改为1000

pull/81/MERGE
小诺 2 years ago committed by 俞宝山
parent
commit
668b3851c5
  1. 2
      snowy-admin-web/src/views/gen/basic.vue
  2. 6
      snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Controller.java.btl
  3. 8
      snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl

2
snowy-admin-web/src/views/gen/basic.vue

@ -279,8 +279,8 @@
const selectTableColumnsData = (tableName, assign) => {
if (!assign) {
formData.value.dbTableKey = undefined
formFieldAssign(tableName)
}
formFieldAssign(tableName)
// tableName
const param = {
tableName: tableName

6
snowy-plugin/snowy-plugin-gen/src/main/resources/backend/Controller.java.btl

@ -12,6 +12,7 @@
*/
package ${packageName}.${moduleName}.modular.${busName}.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
@ -59,6 +60,7 @@ public class ${className}Controller {
*/
@ApiOperationSupport(order = 1)
@ApiOperation("获取${functionName}分页")
@SaCheckPermission("/${moduleName}/${busName}/page")
@GetMapping("/${moduleName}/${busName}/page")
public CommonResult<Page<${className}>> page(${className}PageParam ${classNameFirstLower}PageParam) {
return CommonResult.data(${classNameFirstLower}Service.page(${classNameFirstLower}PageParam));
@ -73,6 +75,7 @@ public class ${className}Controller {
@ApiOperationSupport(order = 2)
@ApiOperation("添加${functionName}")
@CommonLog("添加${functionName}")
@SaCheckPermission("/${moduleName}/${busName}/add")
@PostMapping("/${moduleName}/${busName}/add")
public CommonResult<String> add(@RequestBody @Valid ${className}AddParam ${classNameFirstLower}AddParam) {
${classNameFirstLower}Service.add(${classNameFirstLower}AddParam);
@ -88,6 +91,7 @@ public class ${className}Controller {
@ApiOperationSupport(order = 3)
@ApiOperation("编辑${functionName}")
@CommonLog("编辑${functionName}")
@SaCheckPermission("/${moduleName}/${busName}/edit")
@PostMapping("/${moduleName}/${busName}/edit")
public CommonResult<String> edit(@RequestBody @Valid ${className}EditParam ${classNameFirstLower}EditParam) {
${classNameFirstLower}Service.edit(${classNameFirstLower}EditParam);
@ -103,6 +107,7 @@ public class ${className}Controller {
@ApiOperationSupport(order = 4)
@ApiOperation("删除${functionName}")
@CommonLog("删除${functionName}")
@SaCheckPermission("/${moduleName}/${busName}/delete")
@PostMapping("/${moduleName}/${busName}/delete")
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
CommonValidList<${className}IdParam> ${classNameFirstLower}IdParamList) {
@ -118,6 +123,7 @@ public class ${className}Controller {
*/
@ApiOperationSupport(order = 5)
@ApiOperation("获取${functionName}详情")
@SaCheckPermission("/${moduleName}/${busName}/detail")
@GetMapping("/${moduleName}/${busName}/detail")
public CommonResult<${className}> detail(@Valid ${className}IdParam ${classNameFirstLower}IdParam) {
return CommonResult.data(${classNameFirstLower}Service.detail(${classNameFirstLower}IdParam));

8
snowy-plugin/snowy-plugin-gen/src/main/resources/frontend/form.vue.btl

@ -33,9 +33,9 @@
<% } else if (configList[i].effectType == 'timepicker') {%>
<a-time-picker v-model:value="formData.${configList[i].fieldNameCamelCase}" placeholder="请选择${configList[i].fieldRemark}" style="width: 100%" />
<% } else if (configList[i].effectType == 'inputNumber') {%>
<a-input-number v-model:value="formData.${configList[i].fieldNameCamelCase}" :min="1" :max="100" style="width: 100%" />
<a-input-number v-model:value="formData.${configList[i].fieldNameCamelCase}" :min="1" :max="10000" style="width: 100%" />
<% } else if (configList[i].effectType == 'slider') {%>
<a-slider v-model:value="formData.${configList[i].fieldNameCamelCase}" :max="100" style="width: 100%" />
<a-slider v-model:value="formData.${configList[i].fieldNameCamelCase}" :max="1000" style="width: 100%" />
<% } %>
</a-form-item>
</a-col>
@ -61,9 +61,9 @@
<% } else if (configList[i].effectType == 'timepicker') {%>
<a-time-picker v-model:value="formData.${configList[i].fieldNameCamelCase}" value-format="YYYY-MM-DD HH:mm:ss" show-time placeholder="请选择${configList[i].fieldRemark}" style="width: 100%" />
<% } else if (configList[i].effectType == 'inputNumber') {%>
<a-input-number v-model:value="formData.${configList[i].fieldNameCamelCase}" placeholder="请输入${configList[i].fieldRemark}" :min="1" :max="100" style="width: 100%" />
<a-input-number v-model:value="formData.${configList[i].fieldNameCamelCase}" placeholder="请输入${configList[i].fieldRemark}" :min="1" :max="10000" style="width: 100%" />
<% } else if (configList[i].effectType == 'slider') {%>
<a-slider v-model:value="formData.${configList[i].fieldNameCamelCase}" placeholder="请滑动${configList[i].fieldRemark}" :max="100" style="width: 100%" />
<a-slider v-model:value="formData.${configList[i].fieldNameCamelCase}" placeholder="请滑动${configList[i].fieldRemark}" :max="1000" style="width: 100%" />
<% } %>
</a-form-item>
<% } %>

Loading…
Cancel
Save