Skip to content

Commit fbf1044

Browse files
committed
chore: 更新版本
1 parent eb03572 commit fbf1044

File tree

6 files changed

+57
-1
lines changed

6 files changed

+57
-1
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
AppName = "QuarkGo"
2323

2424
// 版本号
25-
Version = "3.5.8"
25+
Version = "3.5.9"
2626

2727
// 包名
2828
PkgName = "github.com/quarkcloudio/quark-go/v3"

template/admin/resource/actions/drawer_form.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ type DrawerForm struct {
88
DestroyOnClose bool `json:"destroyOnClose"` // 关闭时销毁弹出层里的子元素
99
CancelText string `json:"cancelText"` // 获取取消按钮文案
1010
SubmitText string `json:"submitText"` // 获取提交按钮文案
11+
ApiType string `json:"apiType"` // 表单提交接口的类型,GET 或 POST,默认 POST
12+
TargetBlank bool `json:"targetBlank"` // 提交表单的数据是否打开新页面,只有在GET类型的时候有效
1113
}
1214

1315
// 初始化
@@ -17,6 +19,8 @@ func (p *DrawerForm) TemplateInit(ctx *quark.Context) interface{} {
1719
p.Reload = "table"
1820
p.CancelText = "取消"
1921
p.SubmitText = "提交"
22+
p.ApiType = "POST"
23+
p.TargetBlank = false
2024

2125
return p
2226
}
@@ -50,3 +54,13 @@ func (p *DrawerForm) GetCancelText() string {
5054
func (p *DrawerForm) GetSubmitText() string {
5155
return p.SubmitText
5256
}
57+
58+
// 表单提交接口的类型,GET 或 POST,默认 POST
59+
func (p *DrawerForm) GetApiType() string {
60+
return p.ApiType
61+
}
62+
63+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
64+
func (p *DrawerForm) GetTargetBlank() bool {
65+
return p.TargetBlank
66+
}

template/admin/resource/actions/modal_form.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ type ModalForm struct {
88
DestroyOnClose bool `json:"destroyOnClose"` // 关闭时销毁弹出层里的子元素
99
CancelText string `json:"cancelText"` // 获取取消按钮文案
1010
SubmitText string `json:"submitText"` // 获取提交按钮文案
11+
ApiType string `json:"apiType"` // 表单提交接口的类型,GET 或 POST,默认 POST
12+
TargetBlank bool `json:"targetBlank"` // 提交表单的数据是否打开新页面,只有在GET类型的时候有效
1113
}
1214

1315
// 初始化
@@ -17,6 +19,8 @@ func (p *ModalForm) TemplateInit(ctx *quark.Context) interface{} {
1719
p.Reload = "table"
1820
p.CancelText = "取消"
1921
p.SubmitText = "提交"
22+
p.ApiType = "POST"
23+
p.TargetBlank = false
2024

2125
return p
2226
}
@@ -50,3 +54,13 @@ func (p *ModalForm) GetCancelText() string {
5054
func (p *ModalForm) GetSubmitText() string {
5155
return p.SubmitText
5256
}
57+
58+
// 表单提交接口的类型,GET 或 POST,默认 POST
59+
func (p *ModalForm) GetApiType() string {
60+
return p.ApiType
61+
}
62+
63+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
64+
func (p *ModalForm) GetTargetBlank() bool {
65+
return p.TargetBlank
66+
}

template/admin/resource/resolves_actions.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ func (p *Template) BuildAction(ctx *quark.Context, item interface{}) interface{}
367367
// 关闭时销毁 Modal 里的子元素
368368
modalFormDestroyOnClose := modalFormerActioner.GetDestroyOnClose()
369369

370+
// 表单提交接口的类型,GET 或 POST,默认 POST
371+
modalFormApiType := modalFormerActioner.GetApiType()
372+
373+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
374+
modalFormTargetBlank := modalFormerActioner.GetTargetBlank()
375+
370376
// 构建表单组件
371377
formComponent := form.
372378
New().
@@ -376,6 +382,8 @@ func (p *Template) BuildAction(ctx *quark.Context, item interface{}) interface{}
376382
}).
377383
SetApi(api).
378384
SetInitApi(initApi).
385+
SetApiType(modalFormApiType).
386+
SetTargetBlank(modalFormTargetBlank).
379387
SetBody(formFields).
380388
SetInitialValues(modalFormData).
381389
SetLabelCol(map[string]interface{}{
@@ -440,12 +448,20 @@ func (p *Template) BuildAction(ctx *quark.Context, item interface{}) interface{}
440448
// 关闭时销毁 Modal 里的子元素
441449
drawerFormDestroyOnClose := drawerFormerActioner.GetDestroyOnClose()
442450

451+
// 表单提交接口的类型,GET 或 POST,默认 POST
452+
drawerFormApiType := drawerFormerActioner.GetApiType()
453+
454+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
455+
drawerFormargetBlank := drawerFormerActioner.GetTargetBlank()
456+
443457
// 构建表单组件
444458
formComponent := form.
445459
New().
446460
SetKey(uriKey, false).
447461
SetApi(api).
448462
SetInitApi(initApi).
463+
SetApiType(drawerFormApiType).
464+
SetTargetBlank(drawerFormargetBlank).
449465
SetBody(formFields).
450466
SetInitialValues(drawerFormData).
451467
SetLabelCol(map[string]interface{}{

template/admin/resource/types/drawer_former.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ type DrawerFormer interface {
2222

2323
// 获取提交按钮文案
2424
GetSubmitText() string
25+
26+
// 表单提交接口的类型,GET 或 POST,默认 POST
27+
GetApiType() string
28+
29+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
30+
GetTargetBlank() bool
2531
}

template/admin/resource/types/modal_former.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ type ModalFormer interface {
2222

2323
// 获取提交按钮文案
2424
GetSubmitText() string
25+
26+
// 表单提交接口的类型,GET 或 POST,默认 POST
27+
GetApiType() string
28+
29+
// 提交表单的数据是否打开新页面,只有在GET类型的时候有效
30+
GetTargetBlank() bool
2531
}

0 commit comments

Comments
 (0)