update system proto
This commit is contained in:
parent
f93ddd397f
commit
fde965bbd1
|
@ -19,8 +19,9 @@ message Setting {
|
||||||
int64 created_at = 2 [(aeus.field)={scenarios:"search;view;export",comment:"创建时间"}];
|
int64 created_at = 2 [(aeus.field)={scenarios:"search;view;export",comment:"创建时间"}];
|
||||||
int64 updated_at = 3 [(aeus.field)={scenarios:"search;view;export",comment:"更新时间"}];
|
int64 updated_at = 3 [(aeus.field)={scenarios:"search;view;export",comment:"更新时间"}];
|
||||||
string name = 4 [(aeus.field)={gorm:"size:60",rule:"required",props:"readonly:update",comment: "配置项"},(validate.rules).string = {max_len: 20}];
|
string name = 4 [(aeus.field)={gorm:"size:60",rule:"required",props:"readonly:update",comment: "配置项"},(validate.rules).string = {max_len: 20}];
|
||||||
string value = 5 [(aeus.field)={gorm:"size:512",rule:"required",format:"textarea",comment: "配置值"},(validate.rules).string = {max_len: 512}];
|
string type = 5 [(aeus.field)={gorm:"size:20",rule:"required",enum:"text:文本;number:数字;json:JSON",comment: "数据类型"},(validate.rules).string = {max_len: 20}];
|
||||||
string description = 6 [(aeus.field)={gorm:"size:1024",format:"textarea",scenarios:"create;update;view;export",comment: "备注说明"},(validate.rules).string = {max_len: 1024}];
|
string value = 6 [(aeus.field)={gorm:"size:1024",rule:"required",format:"textarea",comment: "配置值"},(validate.rules).string = {max_len: 1024}];
|
||||||
|
string description = 7 [(aeus.field)={gorm:"size:1024",format:"textarea",scenarios:"create;update;view;export",comment: "备注说明"},(validate.rules).string = {max_len: 1024}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,7 @@ func generateVueFile(prefix string, apiPrefix string, mv *rest.Model) (err error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data := &vueTemplateData{
|
data := &vueTemplateData{
|
||||||
|
Component: inflector.Camelize(mv.Naming().ModuleName) + inflector.Camelize(mv.Naming().Singular),
|
||||||
ModuleName: mv.ModuleName(),
|
ModuleName: mv.ModuleName(),
|
||||||
TableName: mv.TableName(),
|
TableName: mv.TableName(),
|
||||||
Permissions: permissions,
|
Permissions: permissions,
|
||||||
|
@ -221,7 +222,7 @@ func initREST(ctx context.Context, o *options) (err error) {
|
||||||
if err = rest.Init(opts...); err != nil {
|
if err = rest.Init(opts...); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !o.disableModel {
|
if !o.disableModels {
|
||||||
if err = tx.AutoMigrate(getModels()...); err != nil {
|
if err = tx.AutoMigrate(getModels()...); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@ var (
|
||||||
import Viewer from '@/components/fragment/Viewer.vue';
|
import Viewer from '@/components/fragment/Viewer.vue';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: '{{.Name}}'
|
||||||
|
})
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
1
types.go
1
types.go
|
@ -52,6 +52,7 @@ type (
|
||||||
}
|
}
|
||||||
|
|
||||||
vueTemplateData struct {
|
vueTemplateData struct {
|
||||||
|
Component string //组件名称
|
||||||
ModuleName string
|
ModuleName string
|
||||||
TableName string
|
TableName string
|
||||||
ApiPrefix string
|
ApiPrefix string
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package aeusadmin
|
||||||
|
|
||||||
|
import "git.nobla.cn/golang/aeus-admin/models"
|
||||||
|
|
||||||
|
type (
|
||||||
|
menuOptions struct {
|
||||||
|
icon string
|
||||||
|
position int
|
||||||
|
public bool
|
||||||
|
hidden bool
|
||||||
|
description string
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuOption func(o *menuOptions)
|
||||||
|
)
|
||||||
|
|
||||||
|
func WithMenuIcon(icon string) MenuOption {
|
||||||
|
return func(o *menuOptions) {
|
||||||
|
o.icon = icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithMenuPosition(position int) MenuOption {
|
||||||
|
return func(o *menuOptions) {
|
||||||
|
o.position = position
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithMenuPublic(public bool) MenuOption {
|
||||||
|
return func(o *menuOptions) {
|
||||||
|
o.public = public
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithMenuHidden(hidden bool) MenuOption {
|
||||||
|
return func(o *menuOptions) {
|
||||||
|
o.hidden = hidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithMenuDescription(description string) MenuOption {
|
||||||
|
return func(o *menuOptions) {
|
||||||
|
o.description = description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMenu(label string, name string, parent string, uri string, viewPath string, cbs ...MenuOption) *models.Menu {
|
||||||
|
opts := &menuOptions{}
|
||||||
|
for _, cb := range cbs {
|
||||||
|
cb(opts)
|
||||||
|
}
|
||||||
|
model := &models.Menu{}
|
||||||
|
model.Name = name
|
||||||
|
model.Label = label
|
||||||
|
model.Parent = parent
|
||||||
|
model.Uri = uri
|
||||||
|
model.ViewPath = viewPath
|
||||||
|
model.Public = opts.public
|
||||||
|
model.Position = int64(opts.position)
|
||||||
|
model.Icon = opts.icon
|
||||||
|
model.Hidden = opts.hidden
|
||||||
|
model.Description = opts.description
|
||||||
|
return model
|
||||||
|
}
|
Loading…
Reference in New Issue