完善代码生成功能
This commit is contained in:
@@ -12,8 +12,8 @@ using Infrastructure.Enums;
|
||||
using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Models;
|
||||
using {ModelsNamespace}.Dto;
|
||||
using {ModelsNamespace}.Models;
|
||||
|
||||
namespace ZRAdmin.Controllers
|
||||
{
|
||||
@@ -108,6 +108,7 @@ namespace ZRAdmin.Controllers
|
||||
var response = _<#=ServiceName#>.Update(w => w.{primaryKey} == updateModel.{primaryKey}, it => new <#=ModelName#>()
|
||||
{
|
||||
//TODO 字段映射
|
||||
{updateColumn}
|
||||
});
|
||||
|
||||
return SUCCESS(response);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using ZR.Model.Models;
|
||||
using {ModelsNamespace}.Models;
|
||||
|
||||
namespace {IServicsNamespace}.Business
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using {ModelsNamespace}.Dto;
|
||||
using {ModelsNamespace}.Models;
|
||||
|
||||
namespace {DtosNamespace}.Dto
|
||||
{
|
||||
|
||||
@@ -7,9 +7,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ZR.Common;
|
||||
using ZR.Model.Models;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.IService;
|
||||
using {ModelsNamespace}.Models;
|
||||
using {IRepositoriesNamespace};
|
||||
using {ServicesNamespace}.IService;
|
||||
|
||||
namespace {ServicesNamespace}.Business
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
{VueViewFromContent}
|
||||
{VueViewFormContent}
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" v-if="btnSubmitVisible">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
btnSubmitVisible: true,
|
||||
// 表单校验
|
||||
rules: {
|
||||
{VueViewEditFromRuleContent}
|
||||
{VueViewEditFormRuleContent}
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -150,7 +150,7 @@ export default {
|
||||
// 重置数据表单
|
||||
reset() {
|
||||
this.form = {
|
||||
{VueViewEditFromContent}
|
||||
{VueViewEditFormContent}
|
||||
//需个性化处理内容
|
||||
};
|
||||
this.resetForm("form");
|
||||
@@ -184,7 +184,7 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
del{ModelTypeName}().then((res) => {
|
||||
del{ModelTypeName}(row.{primaryKey}).then((res) => {
|
||||
this.msgSuccess("删除成功");
|
||||
this.handleQuery();
|
||||
});
|
||||
@@ -207,7 +207,7 @@ export default {
|
||||
if (valid) {
|
||||
console.log(JSON.stringify(this.form));
|
||||
|
||||
if (this.form.{primaryKey} != undefined) {
|
||||
if (this.form.{primaryKey} != undefined || this.title === '修改数据') {
|
||||
update{ModelTypeName}(this.form).then((res) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
|
||||
Reference in New Issue
Block a user