Skip to content

Commit 990eb10

Browse files
author
奇淼(piexlmax
authored
Merge pull request flipped-aurora#622 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2 parents f105288 + b05990c commit 990eb10

File tree

7 files changed

+143
-124
lines changed

7 files changed

+143
-124
lines changed

server/api/v1/system/sys_menu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (a *AuthorityMenuApi) AddMenuAuthority(c *gin.Context) {
8181
// @Produce application/json
8282
// @Param data body request.GetAuthorityId true "角色ID"
8383
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
84-
// @Router /menu/GetMenuAuthority [post]
84+
// @Router /menu/getMenuAuthority [post]
8585
func (a *AuthorityMenuApi) GetMenuAuthority(c *gin.Context) {
8686
var param request.GetAuthorityId
8787
_ = c.ShouldBindJSON(&param)

server/model/common/request/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type IdsReq struct {
1717

1818
// Get role by id structure
1919
type GetAuthorityId struct {
20-
AuthorityId string // 角色ID
20+
AuthorityId string `json:"authorityId" form:"authorityId"` // 角色ID
2121
}
2222

2323
type Empty struct{}

server/resource/template/web/api.js.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ export const get{{.StructName}}List = (params) => {
9494
method: 'get',
9595
params
9696
})
97-
}
97+
}

server/resource/template/web/form.vue.tpl

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@
33
<el-form :model="formData" label-position="right" label-width="80px">
44
{{- range .Fields}}
55
<el-form-item label="{{.FieldDesc}}:">
6-
{{ if eq .FieldType "bool" -}}
7-
<el-switch active-color="#13ce66" inactive-color="#ff4949" active-text="" inactive-text="" v-model="formData.{{.FieldJson}}" clearable ></el-switch>
8-
{{ end -}}
9-
{{ if eq .FieldType "string" -}}
10-
<el-input v-model="formData.{{.FieldJson}}" clearable placeholder="请输入" />
11-
{{ end -}}
12-
{{ if eq .FieldType "int" -}}
13-
{{ if .DictType -}}
14-
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" clearable>
15-
<el-option v-for="(item,key) in {{ .DictType }}Options" :key="key" :label="item.label" :value="item.value"></el-option>
16-
</el-select>
17-
{{ else -}}
18-
<el-input v-model.number="formData.{{ .FieldJson }}" clearable placeholder="请输入"/>
19-
{{ end -}}
20-
{{ end -}}
21-
{{ if eq .FieldType "time.Time" }}
22-
<el-date-picker type="date" placeholder="选择日期" v-model="formData.{{ .FieldJson }}" clearable></el-date-picker>
23-
{{ end -}}
24-
{{ if eq .FieldType "float64" }}
25-
<el-input-number v-model="formData.{{ .FieldJson }}" :precision="2" clearable></el-input-number>
26-
{{ end -}}
6+
{{- if eq .FieldType "bool" }}
7+
<el-switch active-color="#13ce66" inactive-color="#ff4949" active-text="" inactive-text="" v-model="formData.{{.FieldJson}}" clearable ></el-switch>
8+
{{- end }}
9+
{{- if eq .FieldType "string" }}
10+
<el-input v-model="formData.{{.FieldJson}}" clearable placeholder="请输入" />
11+
{{- end }}
12+
{{- if eq .FieldType "int" }}
13+
{{- if .DictType }}
14+
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" clearable>
15+
<el-option v-for="(item,key) in {{ .DictType }}Options" :key="key" :label="item.label" :value="item.value" />
16+
</el-select>
17+
{{- else }}
18+
<el-input v-model.number="formData.{{ .FieldJson }}" clearable placeholder="请输入" />
19+
{{- end }}
20+
{{- end }}
21+
{{- if eq .FieldType "time.Time" }}
22+
<el-date-picker type="date" placeholder="选择日期" v-model="formData.{{ .FieldJson }}" clearable></el-date-picker>
23+
{{- end }}
24+
{{- if eq .FieldType "float64" }}
25+
<el-input-number v-model="formData.{{ .FieldJson }}" :precision="2" clearable></el-input-number>
26+
{{- end }}
2727
</el-form-item>
28-
{{ end -}}
28+
{{- end }}
2929
<el-form-item>
3030
<el-button size="mini" type="primary" @click="save">保存</el-button>
3131
<el-button size="mini" type="primary" @click="back">返回</el-button>
3232
</el-form-item>
3333
</el-form>
34-
</div>
34+
</div>
3535
</template>
3636

3737
<script>
@@ -47,29 +47,29 @@ export default {
4747
data() {
4848
return {
4949
type: '',
50-
{{range .Fields}}
50+
{{- range .Fields}}
5151
{{- if .DictType }}
5252
{{ .DictType }}Options: [],
53-
{{ end -}}
54-
{{end -}}
53+
{{- end }}
54+
{{- end }}
5555
formData: {
56-
{{range .Fields}}
57-
{{- if eq .FieldType "bool" -}}
58-
{{.FieldJson}}: false,
59-
{{ end -}}
60-
{{- if eq .FieldType "string" -}}
61-
{{.FieldJson}}: '',
62-
{{ end -}}
63-
{{- if eq .FieldType "int" -}}
64-
{{.FieldJson}}: 0,
65-
{{ end -}}
66-
{{- if eq .FieldType "time.Time" -}}
67-
{{.FieldJson}}: new Date(),
68-
{{ end -}}
69-
{{- if eq .FieldType "float64" -}}
70-
{{.FieldJson}}: 0,
71-
{{ end -}}
72-
{{ end }}
56+
{{- range .Fields}}
57+
{{- if eq .FieldType "bool" }}
58+
{{.FieldJson}}: false,
59+
{{- end }}
60+
{{- if eq .FieldType "string" }}
61+
{{.FieldJson}}: '',
62+
{{- end }}
63+
{{- if eq .FieldType "int" }}
64+
{{.FieldJson}}: 0,
65+
{{- end }}
66+
{{- if eq .FieldType "time.Time" }}
67+
{{.FieldJson}}: new Date(),
68+
{{- end }}
69+
{{- if eq .FieldType "float64" }}
70+
{{.FieldJson}}: 0,
71+
{{- end }}
72+
{{- end }}
7373
}
7474
}
7575
},
@@ -84,10 +84,10 @@ export default {
8484
} else {
8585
this.type = 'create'
8686
}
87-
{{ range .Fields -}}
87+
{{- range .Fields }}
8888
{{- if .DictType }}
89-
await this.getDict("{{.DictType}}")
90-
{{ end -}}
89+
await this.getDict('{{.DictType}}')
90+
{{- end }}
9191
{{- end }}
9292
},
9393
methods: {
@@ -119,4 +119,4 @@ export default {
119119
</script>
120120

121121
<style>
122-
</style>
122+
</style>

0 commit comments

Comments
 (0)