Skip to content

Commit

Permalink
Merge pull request #766 from trheyi/main
Browse files Browse the repository at this point in the history
Optimize upload component
  • Loading branch information
trheyi authored Oct 26, 2024
2 parents 2a070f6 + 661c3e6 commit d4c0a23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion widgets/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (dsl DSL) Map() map[string]interface{} {
}

// Add Default Value for Upload api
if dsl.Type == "Upload" && dsl.Props != nil && !dsl.Props.Has("api") {
if (dsl.Type == "Upload" || dsl.Type == "Image") && dsl.Props != nil && !dsl.Props.Has("api") {
res["props"].(map[string]interface{})["$api"] = map[string]interface{}{"process": "fs.data.Upload"}
}

Expand Down
2 changes: 1 addition & 1 deletion widgets/table/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func processComponent(process *gouProcess.Process) interface{} {
// :query
query := map[string]interface{}{}
if process.NumOfArgsIs(4) {
query = process.ArgsMap(3)
query = process.ArgsMap(3, map[string]interface{}{})
}

// execute query
Expand Down
2 changes: 1 addition & 1 deletion widgets/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map
for _, cProp := range dsl.CProps {
err := cProp.Replace(setting, func(cProp component.CloudPropsDSL) interface{} {

if cProp.Type == "Upload" || cProp.Type == "WangEditor" {
if cProp.Type == "Upload" || cProp.Type == "WangEditor" || cProp.Type == "Image" {
return fmt.Sprintf("/api/__yao/table/%s%s", dsl.ID, cProp.UploadPath())
}

Expand Down

0 comments on commit d4c0a23

Please sign in to comment.