fix 一些使用问题

This commit is contained in:
maxbad 2023-05-07 14:16:46 +08:00
parent 9ac036a542
commit e8a0a41cb4
10 changed files with 24 additions and 23 deletions

View File

@ -109,7 +109,7 @@ func setDefault(field *sysin.GenCodesColumnListModel) {
setDefaultValue(field) setDefaultValue(field)
if field.IsAllowNull == "YES" { if field.IsAllowNull == "NO" {
field.Required = true field.Required = true
} }

View File

@ -346,6 +346,15 @@ func (s *sAdminMenu) GetMenuList(ctx context.Context, memberId int64) (lists rol
if err != nil { if err != nil {
return role.DynamicRes{}, err return role.DynamicRes{}, err
} }
if len(array) > 0 {
pidList, err := dao.AdminMenu.Ctx(ctx).Fields("pid").WhereIn("id", array).Group("pid").Array()
if err != nil {
return role.DynamicRes{}, err
}
if len(pidList) > 0 {
array = append(pidList, array...)
}
}
mod = mod.Where("id", array) mod = mod.Where("id", array)
} }

View File

@ -99,7 +99,7 @@ func (s *sSysLog) Export(ctx context.Context, in sysin.LogListInp) (err error) {
// RealWrite 真实写入 // RealWrite 真实写入
func (s *sSysLog) RealWrite(ctx context.Context, commonLog entity.SysLog) (err error) { func (s *sSysLog) RealWrite(ctx context.Context, commonLog entity.SysLog) (err error) {
_, err = dao.SysLog.Ctx(ctx).Data(commonLog).Insert() _, err = dao.SysLog.Ctx(ctx).Data(commonLog).FieldsEx(dao.SysLog.Columns().Id).Insert()
return return
} }

View File

@ -99,7 +99,7 @@ func (s *sSysLoginLog) List(ctx context.Context, in sysin.LoginLogListInp) (list
} }
for _, v := range list { for _, v := range list {
g.DumpWithType(v) //g.DumpWithType(v)
//// 获取省市编码对应的地区名称 //// 获取省市编码对应的地区名称
//region, err := location.ParseRegion(ctx, v.SysLogProvinceId, v.SysLogCityId, 0) //region, err := location.ParseRegion(ctx, v.SysLogProvinceId, v.SysLogCityId, 0)
//if err != nil { //if err != nil {
@ -191,6 +191,6 @@ func (s *sSysLoginLog) Push(ctx context.Context, in sysin.LoginLogPushInp) {
// RealWrite 真实写入 // RealWrite 真实写入
func (s *sSysLoginLog) RealWrite(ctx context.Context, models entity.SysLoginLog) (err error) { func (s *sSysLoginLog) RealWrite(ctx context.Context, models entity.SysLoginLog) (err error) {
_, err = dao.SysLoginLog.Ctx(ctx).Data(models).Insert() _, err = dao.SysLoginLog.Ctx(ctx).Data(models).FieldsEx(dao.SysLoginLog.Columns().Id).Insert()
return return
} }

View File

@ -144,6 +144,6 @@ func (s *sSysServeLog) View(ctx context.Context, in sysin.ServeLogViewInp) (res
// RealWrite 真实写入 // RealWrite 真实写入
func (s *sSysServeLog) RealWrite(ctx context.Context, models entity.SysServeLog) (err error) { func (s *sSysServeLog) RealWrite(ctx context.Context, models entity.SysServeLog) (err error) {
_, err = dao.SysServeLog.Ctx(ctx).Data(models).Insert() _, err = dao.SysServeLog.Ctx(ctx).Data(models).FieldsEx(dao.SysServeLog.Columns().Id).Insert()
return return
} }

View File

@ -38,6 +38,7 @@
"date-fns": "^2.28.0", "date-fns": "^2.28.0",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"highlight.js": "^11.8.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mitt": "^2.1.0", "mitt": "^2.1.0",

View File

@ -118,7 +118,7 @@ export function getChildrenRouter(routerMap: Array<any>) {
* Router * Router
* */ * */
export function isRootRouter(item) { export function isRootRouter(item) {
if (item.meta?.alwaysShow != true && item.children?.length === 1) { if (item.meta?.alwaysShow != true && item.children?.length === 0) {
return true; return true;
} }

View File

@ -120,6 +120,7 @@
NIcon, NIcon,
NTag, NTag,
NIconWrapper, NIconWrapper,
NAvatar,
useMessage, useMessage,
NImage, NImage,
useDialog, useDialog,
@ -159,26 +160,14 @@
}); });
} else { } else {
return h( return h(
NIconWrapper, NAvatar,
{ {
size: 48, size: 48,
borderRadius: 8, color: '#2D8CF0',
},
{
default: () =>
h(
NIcon,
{
size: 36,
style: {
marginTop: '-8px',
},
}, },
{ {
default: () => h(getIconComponent(row.logo)), default: () => h(getIconComponent(row.logo)),
} }
),
}
); );
} }
}, },

View File

@ -10,7 +10,7 @@
{{ view.path }} {{ view.path }}
</n-tag> </n-tag>
<n-scrollbar class="code-scrollbar" trigger="none"> <n-scrollbar class="code-scrollbar" trigger="none">
<n-code :code="view.content" /> <n-code :code="view.content" :hljs="hljs" language="goLang" show-line-numbers />
</n-scrollbar> </n-scrollbar>
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
@ -19,6 +19,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue'; import { computed } from 'vue';
import hljs from 'highlight.js/lib/core';
import goLang from 'highlight.js/lib/languages/go';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import { import {
CheckmarkCircle, CheckmarkCircle,
@ -27,6 +29,7 @@
HelpCircleOutline, HelpCircleOutline,
RemoveCircleOutline, RemoveCircleOutline,
} from '@vicons/ionicons5'; } from '@vicons/ionicons5';
hljs.registerLanguage('goLang', goLang);
interface Props { interface Props {
previewModel: any; previewModel: any;

View File

@ -15,7 +15,6 @@ export const columns = [
{ {
ghost: true, ghost: true,
strong: true, strong: true,
tertiary: true,
size: 'small', size: 'small',
text: true, text: true,
iconPlacement: 'right', iconPlacement: 'right',