File tree 5 files changed +58
-16
lines changed 5 files changed +58
-16
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const (
23
23
AppName = "QuarkGo"
24
24
25
25
// 版本号
26
- Version = "3.9.8 "
26
+ Version = "3.9.9 "
27
27
28
28
// 包名
29
29
PkgName = "github.com/quarkcloudio/quark-go/v3"
Original file line number Diff line number Diff line change @@ -5,13 +5,46 @@ import (
5
5
"github.com/quarkcloudio/quark-go/v3/template/admin/resource/types"
6
6
)
7
7
8
- // 列表工具栏
9
- func (p * Template ) IndexTableMenus (ctx * quark.Context ) interface {} {
8
+ // 列表工具栏菜单项,示例如下:
9
+ //
10
+ // []map[string]string{
11
+ // {
12
+ // "key": "day",
13
+ // "label": "日账单",
14
+ // },
15
+ // {
16
+ // "key": "week",
17
+ // "label": "周账单",
18
+ // },
19
+ // }
20
+ func (p * Template ) IndexTableMenuItems (ctx * quark.Context ) []map [string ]string {
21
+ return []map [string ]string {}
22
+ }
10
23
11
- // 模版实例
24
+ // 列表工具栏菜单,示例如下:
25
+ //
26
+ // map[string]interface{}{
27
+ // "type": "tab",
28
+ // "items": []map[string]string{
29
+ // {
30
+ // "key": "day",
31
+ // "label": "日账单",
32
+ // },
33
+ // {
34
+ // "key": "week",
35
+ // "label": "周账单",
36
+ // },
37
+ // },
38
+ // }
39
+ func (p * Template ) IndexTableMenu (ctx * quark.Context ) interface {} {
12
40
template := ctx .Template .(types.Resourcer )
41
+ items := template .IndexTableMenuItems (ctx )
42
+ if items == nil {
43
+ return map [string ]interface {}{}
44
+ }
13
45
14
- menus := template .Menus (ctx )
15
-
16
- return menus
46
+ return map [string ]interface {}{
47
+ "type" : "tab" ,
48
+ "items" : items ,
49
+ }
17
50
}
Original file line number Diff line number Diff line change @@ -269,11 +269,6 @@ func (p *Template) Actions(ctx *quark.Context) []interface{} {
269
269
return []interface {}{}
270
270
}
271
271
272
- // 菜单
273
- func (p * Template ) Menus (ctx * quark.Context ) interface {} {
274
- return map [string ]interface {}{}
275
- }
276
-
277
272
// 数据导出前回调
278
273
func (p * Template ) BeforeExporting (ctx * quark.Context , list []map [string ]interface {}) []interface {} {
279
274
result := []interface {}{}
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ func (p *Template) IndexTableToolBar(ctx *quark.Context) interface{} {
47
47
return template .GetTableToolBar (ctx ).
48
48
SetTitle (p .IndexTableTitle (ctx )).
49
49
SetActions (p .IndexTableActions (ctx )).
50
- SetMenu (p .IndexTableMenus (ctx ))
50
+ SetMenu (p .IndexTableMenu (ctx ))
51
51
}
52
52
53
53
// 列表页树形表格
Original file line number Diff line number Diff line change @@ -177,9 +177,6 @@ type Resourcer interface {
177
177
// 行为
178
178
Actions (ctx * quark.Context ) []interface {}
179
179
180
- // 菜单
181
- Menus (ctx * quark.Context ) interface {}
182
-
183
180
// 创建行为组件
184
181
BuildAction (ctx * quark.Context , item interface {}) interface {}
185
182
@@ -264,6 +261,23 @@ type Resourcer interface {
264
261
// 列表页工具栏
265
262
IndexTableToolBar (ctx * quark.Context ) interface {}
266
263
264
+ // 列表工具栏菜单
265
+ IndexTableMenu (ctx * quark.Context ) interface {}
266
+
267
+ // 列表工具栏菜单项,示例如下:
268
+ //
269
+ // []map[string]string{
270
+ // {
271
+ // "key": "day",
272
+ // "label": "日账单",
273
+ // },
274
+ // {
275
+ // "key": "week",
276
+ // "label": "周账单",
277
+ // },
278
+ // }
279
+ IndexTableMenuItems (ctx * quark.Context ) []map [string ]string
280
+
267
281
// 列表页树形表格
268
282
IndexTableTreeBar (ctx * quark.Context ) interface {}
269
283
You can’t perform that action at this time.
0 commit comments