Merge pull request #23 from maxbad/v2.0

fix 一些使用中发现的问题
This commit is contained in:
孟帅 2023-05-11 15:20:32 +08:00 committed by GitHub
commit e873204a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 102 additions and 35 deletions

View File

@ -0,0 +1 @@
package modules

View File

@ -27,6 +27,9 @@ import (
) )
func Init(ctx context.Context) { func Init(ctx context.Context) {
// 设置服务日志处理
g.Log().SetHandlers(LoggingServeLogHandler)
_, err := g.Cfg().Get(ctx, "hotgo.debug") _, err := g.Cfg().Get(ctx, "hotgo.debug")
if err != nil { if err != nil {
g.Log().Fatal(ctx, "配置读取异常:", err, "\r\n你确定 config/config.yaml 文件存在且格式正确吗?\r\n") g.Log().Fatal(ctx, "配置读取异常:", err, "\r\n你确定 config/config.yaml 文件存在且格式正确吗?\r\n")
@ -45,9 +48,6 @@ func Init(ctx context.Context) {
// 设置缓存适配器 // 设置缓存适配器
cache.SetAdapter(ctx) cache.SetAdapter(ctx)
// 设置服务日志处理
g.Log().SetHandlers(LoggingServeLogHandler)
// 启动服务监控 // 启动服务监控
service.AdminMonitor().StartMonitor(ctx) service.AdminMonitor().StartMonitor(ctx)

View File

@ -232,6 +232,15 @@ func HasColumn(masterFields []*sysin.GenCodesColumnListModel, column string) boo
return false return false
} }
func HasColumnWithFormMode(masterFields []*sysin.GenCodesColumnListModel, column string) bool {
for _, field := range masterFields {
if field.FormMode == column {
return true
}
}
return false
}
func HasMaxSort(masterFields []*sysin.GenCodesColumnListModel) bool { func HasMaxSort(masterFields []*sysin.GenCodesColumnListModel) bool {
return HasColumn(masterFields, "Sort") return HasColumn(masterFields, "Sort")
} }
@ -247,5 +256,5 @@ func HasSwitch(headOps []string, masterFields []*sysin.GenCodesColumnListModel)
if !gstr.InArray(headOps, "switch") { if !gstr.InArray(headOps, "switch") {
return false return false
} }
return HasColumn(masterFields, "Switch") return HasColumnWithFormMode(masterFields, "Switch")
} }

View File

@ -30,17 +30,18 @@ var Curd = gCurd{}
type gCurd struct{} type gCurd struct{}
type CurdStep struct { type CurdStep struct {
HasMaxSort bool `json:"hasMaxSort"` HasMaxSort bool `json:"hasMaxSort"`
HasAdd bool `json:"hasAdd"` HasAdd bool `json:"hasAdd"`
HasBatchDel bool `json:"hasBatchDel"` HasBatchDel bool `json:"hasBatchDel"`
HasExport bool `json:"hasExport"` HasExport bool `json:"hasExport"`
HasEdit bool `json:"hasEdit"` HasNotFilterAuth bool `json:"hasNotFilterAuth"`
HasDel bool `json:"hasDel"` HasEdit bool `json:"hasEdit"`
HasView bool `json:"hasView"` HasDel bool `json:"hasDel"`
HasStatus bool `json:"hasStatus"` HasView bool `json:"hasView"`
HasSwitch bool `json:"hasSwitch"` HasStatus bool `json:"hasStatus"`
HasCheck bool `json:"hasCheck"` HasSwitch bool `json:"hasSwitch"`
HasMenu bool `json:"hasMenu"` HasCheck bool `json:"hasCheck"`
HasMenu bool `json:"hasMenu"`
} }
type CurdOptionsJoin struct { type CurdOptionsJoin struct {
@ -144,6 +145,7 @@ func initStep(in *CurdPreviewInput) {
in.options.Step.HasAdd = gstr.InArray(in.options.HeadOps, "add") in.options.Step.HasAdd = gstr.InArray(in.options.HeadOps, "add")
in.options.Step.HasBatchDel = gstr.InArray(in.options.HeadOps, "batchDel") in.options.Step.HasBatchDel = gstr.InArray(in.options.HeadOps, "batchDel")
in.options.Step.HasExport = gstr.InArray(in.options.HeadOps, "export") in.options.Step.HasExport = gstr.InArray(in.options.HeadOps, "export")
in.options.Step.HasNotFilterAuth = gstr.InArray(in.options.ColumnOps, "notFilterAuth")
in.options.Step.HasEdit = gstr.InArray(in.options.ColumnOps, "edit") in.options.Step.HasEdit = gstr.InArray(in.options.ColumnOps, "edit")
in.options.Step.HasDel = gstr.InArray(in.options.ColumnOps, "del") in.options.Step.HasDel = gstr.InArray(in.options.ColumnOps, "del")
in.options.Step.HasView = gstr.InArray(in.options.ColumnOps, "view") in.options.Step.HasView = gstr.InArray(in.options.ColumnOps, "view")

View File

@ -21,8 +21,9 @@ const (
LogicListSimpleSelect = "\tfields, err := hgorm.GenSelect(ctx, sysin.%sListModel{}, dao.%s)\n\tif err != nil {\n\t\treturn\n\t}" LogicListSimpleSelect = "\tfields, err := hgorm.GenSelect(ctx, sysin.%sListModel{}, dao.%s)\n\tif err != nil {\n\t\treturn\n\t}"
LogicListJoinSelect = "\t//关联表select\n\tfields, err := hgorm.GenJoinSelect(ctx, %sin.%sListModel{}, dao.%s, []*hgorm.Join{\n%v\t})" LogicListJoinSelect = "\t//关联表select\n\tfields, err := hgorm.GenJoinSelect(ctx, %sin.%sListModel{}, dao.%s, []*hgorm.Join{\n%v\t})"
LogicListJoinOnRelation = "\t// 关联表%s\n\tmod = mod.%s(hgorm.GenJoinOnRelation(\n\t\tdao.%s.Table(), dao.%s.Columns().%s, // 主表表名,关联字段\n\t\tdao.%s.Table(), \"%s\", dao.%s.Columns().%s, // 关联表表名,别名,关联字段\n\t)...)\n\n" LogicListJoinOnRelation = "\t// 关联表%s\n\tmod = mod.%s(hgorm.GenJoinOnRelation(\n\t\tdao.%s.Table(), dao.%s.Columns().%s, // 主表表名,关联字段\n\t\tdao.%s.Table(), \"%s\", dao.%s.Columns().%s, // 关联表表名,别名,关联字段\n\t)...)\n\n"
LogicEditUpdate = "\t\t_, err = s.Model(ctx).\n\t\t\tFieldsEx(\n%s\t\t\t).\n\t\t\tWhere(dao.%s.Columns().%s, in.%s).Data(in).Update()\n\t\treturn " LogicEditUpdate = "\t\t_, err = s.Model(ctx%s).\n\t\t\tFieldsEx(\n%s\t\t\t).\n\t\t\tWhere(dao.%s.Columns().%s, in.%s).Data(in).Update()\n\t\treturn "
LogicEditInsert = "\t_, err = s.Model(ctx, &handler.Option{FilterAuth: false}).\n\t\tFieldsEx(\n%s\t\t).\n\t\tData(in).Insert()" LogicEditInsert = "\t_, err = s.Model(ctx, &handler.Option{FilterAuth: false}).\n\t\tFieldsEx(\n%s\t\t).\n\t\tData(in).Insert()"
LogicEditUnique = "\t// 验证'%s'唯一\n\tif err = hgorm.IsUnique(ctx, dao.%s, g.Map{dao.%s.Columns().%s: in.%s}, \"%s已存在\", in.Id); err != nil {\n\t\treturn\n\t}\n"
LogicSwitchUpdate = "g.Map{\n\t\tin.Key: in.Value,\n%s}" LogicSwitchUpdate = "g.Map{\n\t\tin.Key: in.Value,\n%s}"
LogicStatusUpdate = "g.Map{\n\t\tdao.%s.Columns().Status: in.Status,\n%s}" LogicStatusUpdate = "g.Map{\n\t\tdao.%s.Columns().Status: in.Status,\n%s}"
) )
@ -66,7 +67,11 @@ func (l *gCurd) generateLogicSwitchUpdate(ctx context.Context, in *CurdPreviewIn
func (l *gCurd) generateLogicSwitchFields(ctx context.Context, in *CurdPreviewInput) string { func (l *gCurd) generateLogicSwitchFields(ctx context.Context, in *CurdPreviewInput) string {
buffer := bytes.NewBuffer(nil) buffer := bytes.NewBuffer(nil)
if in.options.Step.HasSwitch { if in.options.Step.HasSwitch {
buffer.WriteString("\t\tdao." + in.In.DaoName + ".Columns().Switch,\n") for _, field := range in.masterFields {
if field.FormMode == "Switch" {
buffer.WriteString("\t\tdao." + in.In.DaoName + ".Columns()." + field.GoName + ",\n")
}
}
} }
return buffer.String() return buffer.String()
} }
@ -78,6 +83,7 @@ func (l *gCurd) generateLogicEdit(ctx context.Context, in *CurdPreviewInput) g.M
updateBuffer = bytes.NewBuffer(nil) updateBuffer = bytes.NewBuffer(nil)
insertFieldsEx = "" insertFieldsEx = ""
insertBuffer = bytes.NewBuffer(nil) insertBuffer = bytes.NewBuffer(nil)
uniqueBuffer = bytes.NewBuffer(nil)
) )
for _, field := range in.masterFields { for _, field := range in.masterFields {
@ -96,13 +102,23 @@ func (l *gCurd) generateLogicEdit(ctx context.Context, in *CurdPreviewInput) g.M
if field.Index == consts.GenCodesIndexPK || field.GoName == "UpdatedBy" || field.GoName == "DeletedAt" { if field.Index == consts.GenCodesIndexPK || field.GoName == "UpdatedBy" || field.GoName == "DeletedAt" {
insertFieldsEx = insertFieldsEx + "\t\t\t\tdao." + in.In.DaoName + ".Columns()." + field.GoName + ",\n" insertFieldsEx = insertFieldsEx + "\t\t\t\tdao." + in.In.DaoName + ".Columns()." + field.GoName + ",\n"
} }
if field.Unique {
uniqueBuffer.WriteString(fmt.Sprintf(LogicEditUnique, field.GoName, in.In.DaoName, in.In.DaoName, field.GoName, field.GoName, field.Dc))
}
} }
updateBuffer.WriteString(fmt.Sprintf(LogicEditUpdate, updateFieldsEx, in.In.DaoName, in.pk.GoName, in.pk.GoName)) notFilterAuth := ""
if gstr.InArray(in.options.ColumnOps, "notFilterAuth") {
notFilterAuth = ", &handler.Option{FilterAuth: false}"
}
updateBuffer.WriteString(fmt.Sprintf(LogicEditUpdate, notFilterAuth, updateFieldsEx, in.In.DaoName, in.pk.GoName, in.pk.GoName))
insertBuffer.WriteString(fmt.Sprintf(LogicEditInsert, insertFieldsEx)) insertBuffer.WriteString(fmt.Sprintf(LogicEditInsert, insertFieldsEx))
data["update"] = updateBuffer.String() data["update"] = updateBuffer.String()
data["insert"] = insertBuffer.String() data["insert"] = insertBuffer.String()
data["unique"] = uniqueBuffer.String()
return data return data
} }

View File

@ -135,11 +135,15 @@ func (l *gCurd) generateWebModelRules(ctx context.Context, in *CurdPreviewInput)
buffer := bytes.NewBuffer(nil) buffer := bytes.NewBuffer(nil)
buffer.WriteString("export const rules = {\n") buffer.WriteString("export const rules = {\n")
for _, field := range in.masterFields { for _, field := range in.masterFields {
if field.FormRole == "" || field.FormRole == FormRoleNone { if !field.IsEdit || (!field.Required && (field.FormRole == "" || field.FormRole == FormRoleNone)) {
continue continue
} }
buffer.WriteString(fmt.Sprintf(" %s: {\n required: %v,\n trigger: ['blur', 'input'],\n message: '请输入%s',\n validator: validate.%v,\n },\n", field.TsName, field.Required, field.Dc, field.FormRole)) if field.FormRole == "" || field.FormRole == FormRoleNone {
buffer.WriteString(fmt.Sprintf(" %s: {\n required: %v,\n trigger: ['blur', 'input'],\n type: '%s',\n message: '请输入%s',\n },\n", field.TsName, field.Required, field.TsType, field.Dc))
} else {
buffer.WriteString(fmt.Sprintf(" %s: {\n required: %v,\n trigger: ['blur', 'input'],\n type: '%s',\n message: '请输入%s',\n validator: validate.%v,\n },\n", field.TsName, field.Required, field.TsType, field.Dc, field.FormRole))
}
} }
buffer.WriteString("};\n") buffer.WriteString("};\n")
return buffer.String() return buffer.String()

View File

@ -47,7 +47,7 @@ func (s *s@{.servFunName}) Model(ctx context.Context, option ...*handler.Option)
// List 获取@{.tableComment}列表 // List 获取@{.tableComment}列表
func (s *s@{.servFunName}) List(ctx context.Context, in @{.templateGroup}in.@{.varName}ListInp) (list []*@{.templateGroup}in.@{.varName}ListModel, totalCount int, err error) { func (s *s@{.servFunName}) List(ctx context.Context, in @{.templateGroup}in.@{.varName}ListInp) (list []*@{.templateGroup}in.@{.varName}ListModel, totalCount int, err error) {
mod := s.Model(ctx) mod := s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end})
@{.listWhere} @{.listWhere}
@{.listJoin.link} @{.listJoin.link}
totalCount, err = mod.Clone().Count() totalCount, err = mod.Clone().Count()
@ -89,6 +89,7 @@ func (s *s@{.servFunName}) Export(ctx context.Context, in @{.templateGroup}in.@{
@{ if eq .options.Step.HasEdit true } @{ if eq .options.Step.HasEdit true }
// Edit 修改/新增@{.tableComment} // Edit 修改/新增@{.tableComment}
func (s *s@{.servFunName}) Edit(ctx context.Context, in @{.templateGroup}in.@{.varName}EditInp) (err error) { func (s *s@{.servFunName}) Edit(ctx context.Context, in @{.templateGroup}in.@{.varName}EditInp) (err error) {
@{.edit.unique}
// 修改 // 修改
if in.@{.pk.GoName} > 0 { if in.@{.pk.GoName} > 0 {
@{.edit.update} @{.edit.update}
@ -102,7 +103,7 @@ func (s *s@{.servFunName}) Edit(ctx context.Context, in @{.templateGroup}in.@{.v
@{ if eq .options.Step.HasDel true } @{ if eq .options.Step.HasDel true }
// Delete 删除@{.tableComment} // Delete 删除@{.tableComment}
func (s *s@{.servFunName}) Delete(ctx context.Context, in @{.templateGroup}in.@{.varName}DeleteInp) (err error) { func (s *s@{.servFunName}) Delete(ctx context.Context, in @{.templateGroup}in.@{.varName}DeleteInp) (err error) {
_, err = s.Model(ctx).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Delete() _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Delete()
return return
}@{end} }@{end}
@{ if and (eq .options.Step.HasEdit true) (eq .options.Step.HasMaxSort true) } @{ if and (eq .options.Step.HasEdit true) (eq .options.Step.HasMaxSort true) }
@ -123,7 +124,7 @@ func (s *s@{.servFunName}) MaxSort(ctx context.Context, in @{.templateGroup}in.@
@{ if or (eq .options.Step.HasView true) (eq .options.Step.HasEdit true) } @{ if or (eq .options.Step.HasView true) (eq .options.Step.HasEdit true) }
// View 获取@{.tableComment}指定信息 // View 获取@{.tableComment}指定信息
func (s *s@{.servFunName}) View(ctx context.Context, in @{.templateGroup}in.@{.varName}ViewInp) (res *@{.templateGroup}in.@{.varName}ViewModel, err error) { func (s *s@{.servFunName}) View(ctx context.Context, in @{.templateGroup}in.@{.varName}ViewInp) (res *@{.templateGroup}in.@{.varName}ViewModel, err error) {
err = s.Model(ctx).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Scan(&res) err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Scan(&res)
return return
}@{end} }@{end}
@{ if eq .options.Step.HasStatus true } @{ if eq .options.Step.HasStatus true }
@ -144,7 +145,7 @@ func (s *s@{.servFunName}) Status(ctx context.Context, in @{.templateGroup}in.@{
return return
} }
_, err = s.Model(ctx).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Data(@{.statusUpdate}).Update() _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Data(@{.statusUpdate}).Update()
return return
} }
@{end} @{end}
@ -161,7 +162,7 @@ func (s *s@{.servFunName}) Switch(ctx context.Context, in @{.templateGroup}in.@{
return return
} }
_, err = s.Model(ctx).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Data(@{.switchUpdate}).Update() _, err = s.Model(ctx@{ if eq .options.Step.HasNotFilterAuth true } ,&handler.Option{FilterAuth: false}@{end}).Where(dao.@{.daoName}.Columns().@{.pk.GoName}, in.@{.pk.GoName}).Data(@{.switchUpdate}).Update()
return return
} }
@{end} @{end}

View File

@ -3,7 +3,7 @@ import { NAvatar, NImage, NTag, NSwitch, NRate } from 'naive-ui';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import { FormSchema } from '@/components/Form'; import { FormSchema } from '@/components/Form';
import { Dicts } from '@/api/dict/dict'; import { Dicts } from '@/api/dict/dict';
@{ if eq .options.Step.HasSwitch true }import { Switch } from '@/api/@{.varName | LcFirst}';@{end} @{ if eq .options.Step.HasSwitch true }import { Switch } from '@{.importWebApi}';@{end}
import { isArray, isNullObject } from '@/utils/is'; import { isArray, isNullObject } from '@/utils/is';
import { getFileExt } from '@/utils/urlUtils'; import { getFileExt } from '@/utils/urlUtils';
import { defRangeShortcuts, defShortcuts, formatToDate } from '@/utils/dateUtil'; import { defRangeShortcuts, defShortcuts, formatToDate } from '@/utils/dateUtil';

View File

@ -104,7 +104,16 @@
<QuestionCircleOutlined /> <QuestionCircleOutlined />
</n-icon> </n-icon>
</template> </template>
<span>主表中存在`switch`字段时才会生效</span> <span>表单组件中存在`开关`类型才会生效</span>
</n-popover>
<n-checkbox value="notFilterAuth" label="不过滤权限" />
<n-popover trigger="hover">
<template #trigger>
<n-icon size="15" class="tips-help-icon" color="#2d8cf0">
<QuestionCircleOutlined />
</n-icon>
</template>
<span>系统默认会过滤权限勾选后强制不开启权限验证</span>
</n-popover> </n-popover>
</n-space> </n-space>
</n-checkbox-group> </n-checkbox-group>

View File

@ -82,6 +82,7 @@
const dataSource = ref(formValue.value.masterColumns); const dataSource = ref(formValue.value.masterColumns);
async function reloadFields(loading = false) { async function reloadFields(loading = false) {
dataSource.value = [];
if (loading) { if (loading) {
show.value = true; show.value = true;
} }

View File

@ -115,7 +115,19 @@
<n-form-item label="根路由" path="isRoot"> <n-form-item label="根路由" path="isRoot">
<n-radio-group v-model:value="formParams.isRoot" name="isRoot"> <n-radio-group v-model:value="formParams.isRoot" name="isRoot">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value"
:value="switchStatus.value"
:label="switchStatus.label"
/>
</n-radio-group>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="页签固定" path="affix">
<n-radio-group v-model:value="formParams.affix" name="affix">
<n-radio-button
v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -127,7 +139,7 @@
<n-form-item label="简化路由" path="alwaysShow"> <n-form-item label="简化路由" path="alwaysShow">
<n-radio-group v-model:value="formParams.alwaysShow" name="alwaysShow"> <n-radio-group v-model:value="formParams.alwaysShow" name="alwaysShow">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -142,7 +154,7 @@
<n-form-item label="缓存路由" path="keepAlive"> <n-form-item label="缓存路由" path="keepAlive">
<n-radio-group v-model:value="formParams.keepAlive" name="keepAlive"> <n-radio-group v-model:value="formParams.keepAlive" name="keepAlive">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -169,7 +181,7 @@
<n-form-item label="是否外链" path="isFrame"> <n-form-item label="是否外链" path="isFrame">
<n-radio-group v-model:value="formParams.isFrame" name="isFrame"> <n-radio-group v-model:value="formParams.isFrame" name="isFrame">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"

View File

@ -262,7 +262,19 @@
<n-form-item label="根路由" path="isRoot"> <n-form-item label="根路由" path="isRoot">
<n-radio-group v-model:value="formParams.isRoot" name="isRoot"> <n-radio-group v-model:value="formParams.isRoot" name="isRoot">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value"
:value="switchStatus.value"
:label="switchStatus.label"
/>
</n-radio-group>
</n-form-item>
</n-gi>
<n-gi>
<n-form-item label="页签固定" path="affix">
<n-radio-group v-model:value="formParams.affix" name="affix">
<n-radio-button
v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -274,7 +286,7 @@
<n-form-item label="简化路由" path="alwaysShow"> <n-form-item label="简化路由" path="alwaysShow">
<n-radio-group v-model:value="formParams.alwaysShow" name="alwaysShow"> <n-radio-group v-model:value="formParams.alwaysShow" name="alwaysShow">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -286,7 +298,7 @@
<n-form-item label="缓存路由" path="keepAlive"> <n-form-item label="缓存路由" path="keepAlive">
<n-radio-group v-model:value="formParams.keepAlive" name="keepAlive"> <n-radio-group v-model:value="formParams.keepAlive" name="keepAlive">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"
@ -325,7 +337,7 @@
<n-form-item label="是否外链" path="isFrame"> <n-form-item label="是否外链" path="isFrame">
<n-radio-group v-model:value="formParams.isFrame" name="isFrame"> <n-radio-group v-model:value="formParams.isFrame" name="isFrame">
<n-radio-button <n-radio-button
v-for="switchStatus in switchStatusMap" v-for="switchStatus in statusMap"
:key="switchStatus.value" :key="switchStatus.value"
:value="switchStatus.value" :value="switchStatus.value"
:label="switchStatus.label" :label="switchStatus.label"