调整前端样式,调整日志记录路由组,调整对应自动化模板

This commit is contained in:
蒋吉兆
2021-09-20 21:40:23 +08:00
parent 6a8e35379a
commit 2cbb87baaa
28 changed files with 161 additions and 139 deletions

View File

@@ -12,13 +12,16 @@ type {{.StructName}}Router struct {
// Init{{.StructName}}Router 初始化 {{.StructName}} 路由信息
func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGroup) {
{{.Abbreviation}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
{{.Abbreviation}}RouterWithoutRecord := Router.Group("{{.Abbreviation}}")
var {{.Abbreviation}}Api = v1.ApiGroupApp.AutoCodeApiGroup.{{.StructName}}Api
{
{{.Abbreviation}}Router.POST("create{{.StructName}}", {{.Abbreviation}}Api.Create{{.StructName}}) // {{.StructName}}
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}", {{.Abbreviation}}Api.Delete{{.StructName}}) // {{.StructName}}
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}ByIds", {{.Abbreviation}}Api.Delete{{.StructName}}ByIds) // {{.StructName}}
{{.Abbreviation}}Router.PUT("update{{.StructName}}", {{.Abbreviation}}Api.Update{{.StructName}}) // {{.StructName}}
{{.Abbreviation}}Router.GET("find{{.StructName}}", {{.Abbreviation}}Api.Find{{.StructName}}) // ID获取{{.StructName}}
{{.Abbreviation}}Router.GET("get{{.StructName}}List", {{.Abbreviation}}Api.Get{{.StructName}}List) // {{.StructName}}
}
{
{{.Abbreviation}}RouterWithoutRecord.GET("find{{.StructName}}", {{.Abbreviation}}Api.Find{{.StructName}}) // ID获取{{.StructName}}
{{.Abbreviation}}RouterWithoutRecord.GET("get{{.StructName}}List", {{.Abbreviation}}Api.Get{{.StructName}}List) // {{.StructName}}
}
}

View File

@@ -49,24 +49,24 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="日期" width="180">
<el-table-column align="center" label="日期" width="180">
<template #default="scope">{{ "{{ formatDate(scope.row.CreatedAt) }}" }}</template>
</el-table-column>
{{- range .Fields}}
{{- if .DictType}}
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<template #default="scope">
{{"{{"}} filterDict(scope.row.{{.FieldJson}},"{{.DictType}}") {{"}}"}}
</template>
</el-table-column>
{{- else if eq .FieldType "bool" }}
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<template #default="scope">{{"{{"}} formatBoolean(scope.row.{{.FieldJson}}) {{"}}"}}</template>
</el-table-column> {{- else }}
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
{{- end }}
{{- end }}
<el-table-column label="按钮组">
<el-table-column align="center" label="按钮组">
<template #default="scope">
<el-button type="text" icon="el-icon-edit" size="small" class="table-button" @click="update{{.StructName}}(scope.row)">变更</el-button>
<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>