ui
This commit is contained in:
@@ -377,7 +377,8 @@ func convertToUITree(data []*db.SysMenu, parentID int32) []*dto.MenuUIDto {
|
||||
Icon: item.Avatar,
|
||||
Type: 1,
|
||||
OpenType: "_iframe",
|
||||
Href: item.Url,
|
||||
// OpenType: "_component",
|
||||
Href: item.Url,
|
||||
}
|
||||
root = append(root, temp)
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,7 @@ package tpl
|
||||
import (
|
||||
"html/template"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"management/internal/db/model/dto"
|
||||
)
|
||||
@@ -18,9 +19,10 @@ func (r *render) btnFuncs() map[string]any {
|
||||
var res string
|
||||
for _, action := range actionNames {
|
||||
for _, btn := range btns {
|
||||
btn.Style = strings.ReplaceAll(btn.Style, "pear", "layui")
|
||||
base := filepath.Base(btn.Url)
|
||||
if base == action {
|
||||
res += `<button type="button" class="pear-btn ` + btn.Style + `" lay-event="` + firstLower(action) + `" lay-on="` + firstLower(action) + `">`
|
||||
res += `<button type="button" class="layui-btn ` + btn.Style + `" lay-event="` + firstLower(action) + `" lay-on="` + firstLower(action) + `">`
|
||||
if len(btn.Avatar) > 0 {
|
||||
res += `<i class="` + btn.Avatar + `"></i> `
|
||||
}
|
||||
@@ -40,9 +42,10 @@ func (r *render) btnFuncs() map[string]any {
|
||||
var res string
|
||||
for _, action := range actionNames {
|
||||
for _, btn := range btns {
|
||||
btn.Style = strings.ReplaceAll(btn.Style, "pear", "layui")
|
||||
base := filepath.Base(btn.Url)
|
||||
if base == action {
|
||||
res += `<button type="button" style="font-size:12px !important;" class="pear-btn ` + btn.Style + `" lay-event="` + firstLower(action) + `" lay-on="` + firstLower(action) + `">`
|
||||
res += `<button type="button" style="font-size:12px !important;" class="layui-btn ` + btn.Style + `" lay-event="` + firstLower(action) + `" lay-on="` + firstLower(action) + `">`
|
||||
if len(btn.Avatar) > 0 {
|
||||
res += `<i class="` + btn.Avatar + `"></i> `
|
||||
}
|
||||
@@ -69,9 +72,10 @@ func (r *render) btnFuncs() map[string]any {
|
||||
var res string
|
||||
for _, action := range actionNames {
|
||||
for _, btn := range btns {
|
||||
btn.Style = strings.ReplaceAll(btn.Style, "pear", "layui")
|
||||
base := filepath.Base(btn.Url)
|
||||
if base == action {
|
||||
res += `<button type="submit" class="pear-btn ` + btn.Style + `" lay-submit lay-filter="` + firstLower(action) + `">`
|
||||
res += `<button type="submit" class="layui-btn ` + btn.Style + `" lay-submit lay-filter="` + firstLower(action) + `">`
|
||||
if len(btn.Avatar) > 0 {
|
||||
res += `<i class="` + btn.Avatar + `"></i> `
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user