Skip to content

Commit c5daed4

Browse files
author
奇淼(piexlmax
authored
Merge pull request #723 from flipped-aurora/gva-vue3
发布v2.4.5 bate.1
2 parents 203e999 + 46442f4 commit c5daed4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2032
-2707
lines changed

.deepsource.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

server/core/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func RunWindowsServer() {
3838

3939
fmt.Printf(`
4040
欢迎使用 github.com/flipped-aurora/gin-vue-admin/server
41-
当前版本:V2.4.5 beta
41+
当前版本:V2.4.5 beta.1
4242
加群方式:微信号:shouzi_1994 QQ群:622360840
4343
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
4444
默认前端文件运行地址:http://127.0.0.1:8080

server/resource/template/server/router.go.tpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ type {{.StructName}}Router struct {
1212
// Init{{.StructName}}Router 初始化 {{.StructName}} 路由信息
1313
func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGroup) {
1414
{{.Abbreviation}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
15+
{{.Abbreviation}}RouterWithoutRecord := Router.Group("{{.Abbreviation}}")
1516
var {{.Abbreviation}}Api = v1.ApiGroupApp.AutoCodeApiGroup.{{.StructName}}Api
1617
{
1718
{{.Abbreviation}}Router.POST("create{{.StructName}}", {{.Abbreviation}}Api.Create{{.StructName}}) // 新建{{.StructName}}
1819
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}", {{.Abbreviation}}Api.Delete{{.StructName}}) // 删除{{.StructName}}
1920
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}ByIds", {{.Abbreviation}}Api.Delete{{.StructName}}ByIds) // 批量删除{{.StructName}}
2021
{{.Abbreviation}}Router.PUT("update{{.StructName}}", {{.Abbreviation}}Api.Update{{.StructName}}) // 更新{{.StructName}}
21-
{{.Abbreviation}}Router.GET("find{{.StructName}}", {{.Abbreviation}}Api.Find{{.StructName}}) // 根据ID获取{{.StructName}}
22-
{{.Abbreviation}}Router.GET("get{{.StructName}}List", {{.Abbreviation}}Api.Get{{.StructName}}List) // 获取{{.StructName}}列表
22+
}
23+
{
24+
{{.Abbreviation}}RouterWithoutRecord.GET("find{{.StructName}}", {{.Abbreviation}}Api.Find{{.StructName}}) // 根据ID获取{{.StructName}}
25+
{{.Abbreviation}}RouterWithoutRecord.GET("get{{.StructName}}List", {{.Abbreviation}}Api.Get{{.StructName}}List) // 获取{{.StructName}}列表
2326
}
2427
}

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

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
<template>
22
<div>
3-
<el-form :model="formData" label-position="right" label-width="80px">
4-
{{- range .Fields}}
5-
<el-form-item label="{{.FieldDesc}}:">
6-
{{- if eq .FieldType "bool" }}
7-
<el-switch v-model="formData.{{.FieldJson}}" active-color="#13ce66" inactive-color="#ff4949" active-text="" inactive-text="" 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 v-model="formData.{{ .FieldJson }}" type="date" placeholder="选择日期" 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 }}
27-
</el-form-item>
28-
{{- end }}
29-
<el-form-item>
30-
<el-button size="mini" type="primary" @click="save">保存</el-button>
31-
<el-button size="mini" type="primary" @click="back">返回</el-button>
32-
</el-form-item>
33-
</el-form>
3+
<div class="gva-form-box">
4+
<el-form :model="formData" label-position="right" label-width="80px">
5+
{{- range .Fields}}
6+
<el-form-item label="{{.FieldDesc}}:">
7+
{{- if eq .FieldType "bool" }}
8+
<el-switch v-model="formData.{{.FieldJson}}" active-color="#13ce66" inactive-color="#ff4949" active-text="" inactive-text="" clearable ></el-switch>
9+
{{- end }}
10+
{{- if eq .FieldType "string" }}
11+
<el-input v-model="formData.{{.FieldJson}}" clearable placeholder="请输入" />
12+
{{- end }}
13+
{{- if eq .FieldType "int" }}
14+
{{- if .DictType }}
15+
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" clearable>
16+
<el-option v-for="(item,key) in {{ .DictType }}Options" :key="key" :label="item.label" :value="item.value" />
17+
</el-select>
18+
{{- else }}
19+
<el-input v-model.number="formData.{{ .FieldJson }}" clearable placeholder="请输入" />
20+
{{- end }}
21+
{{- end }}
22+
{{- if eq .FieldType "time.Time" }}
23+
<el-date-picker v-model="formData.{{ .FieldJson }}" type="date" placeholder="选择日期" clearable></el-date-picker>
24+
{{- end }}
25+
{{- if eq .FieldType "float64" }}
26+
<el-input-number v-model="formData.{{ .FieldJson }}" :precision="2" clearable></el-input-number>
27+
{{- end }}
28+
</el-form-item>
29+
{{- end }}
30+
<el-form-item>
31+
<el-button size="mini" type="primary" @click="save">保存</el-button>
32+
<el-button size="mini" type="primary" @click="back">返回</el-button>
33+
</el-form-item>
34+
</el-form>
35+
</div>
3436
</div>
3537
</template>
3638

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

Lines changed: 72 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<div class="search-term">
3+
<div class="gva-search-box">
44
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
55
{{- range .Fields}} {{- if .FieldSearchType}} {{- if eq .FieldType "bool" }}
66
<el-form-item label="{{.FieldDesc}}" prop="{{.FieldJson}}">
@@ -21,66 +21,71 @@
2121
<el-form-item label="{{.FieldDesc}}">
2222
<el-input v-model="searchInfo.{{.FieldJson}}" placeholder="搜索条件" />
2323
</el-form-item>{{ end }}{{ end }}{{ end }}
24+
<el-form-item>
25+
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
26+
<el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button>
27+
</el-form-item>
2428
</el-form>
25-
<div class="gva-btn-list">
26-
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
27-
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>
28-
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
29-
<p>确定要删除吗?</p>
30-
<div style="text-align: right; margin: 0">
31-
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
32-
<el-button size="mini" type="primary" @click="onDelete">确定</el-button>
33-
</div>
34-
<template #reference>
35-
<el-button icon="el-icon-delete" size="mini" type="danger" style="margin-left: 10px;">批量删除</el-button>
36-
</template>
37-
</el-popover>
38-
</div>
3929
</div>
40-
<el-table
41-
ref="multipleTable"
42-
border
43-
stripe
44-
style="width: 100%"
45-
tooltip-effect="dark"
46-
:data="tableData"
47-
@selection-change="handleSelectionChange"
48-
>
49-
<el-table-column type="selection" width="55" />
50-
<el-table-column label="日期" width="180">
51-
<template #default="scope">{{ "{{ formatDate(scope.row.CreatedAt) }}" }}</template>
52-
</el-table-column>
53-
{{- range .Fields}}
54-
{{- if .DictType}}
55-
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
56-
<template #default="scope">
57-
{{"{{"}} filterDict(scope.row.{{.FieldJson}},"{{.DictType}}") {{"}}"}}
58-
</template>
59-
</el-table-column>
60-
{{- else if eq .FieldType "bool" }}
61-
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
62-
<template #default="scope">{{"{{"}} formatBoolean(scope.row.{{.FieldJson}}) {{"}}"}}</template>
63-
</el-table-column> {{- else }}
64-
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
65-
{{- end }}
66-
{{- end }}
67-
<el-table-column label="按钮组">
68-
<template #default="scope">
69-
<el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="update{{.StructName}}(scope.row)">变更</el-button>
70-
<el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
71-
</template>
72-
</el-table-column>
73-
</el-table>
74-
<el-pagination
75-
layout="total, sizes, prev, pager, next, jumper"
76-
:current-page="page"
77-
:page-size="pageSize"
78-
:page-sizes="[10, 30, 50, 100]"
79-
:style="{float:'right',padding:'20px'}"
80-
:total="total"
81-
@current-change="handleCurrentChange"
82-
@size-change="handleSizeChange"
83-
/>
30+
<div class="gva-table-box">
31+
<div class="gva-btn-list">
32+
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openDialog">新增</el-button>
33+
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
34+
<p>确定要删除吗?</p>
35+
<div style="text-align: right; margin-top: 8px;">
36+
<el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
37+
<el-button size="mini" type="primary" @click="onDelete">确定</el-button>
38+
</div>
39+
<template #reference>
40+
<el-button icon="el-icon-delete" size="mini" style="margin-left: 10px;">删除</el-button>
41+
</template>
42+
</el-popover>
43+
</div>
44+
<el-table
45+
ref="multipleTable"
46+
style="width: 100%"
47+
tooltip-effect="dark"
48+
:data="tableData"
49+
row-key="ID"
50+
@selection-change="handleSelectionChange"
51+
>
52+
<el-table-column type="selection" width="55" />
53+
<el-table-column align="center" label="日期" width="180">
54+
<template #default="scope">{{ "{{ formatDate(scope.row.CreatedAt) }}" }}</template>
55+
</el-table-column>
56+
{{- range .Fields}}
57+
{{- if .DictType}}
58+
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
59+
<template #default="scope">
60+
{{"{{"}} filterDict(scope.row.{{.FieldJson}},"{{.DictType}}") {{"}}"}}
61+
</template>
62+
</el-table-column>
63+
{{- else if eq .FieldType "bool" }}
64+
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
65+
<template #default="scope">{{"{{"}} formatBoolean(scope.row.{{.FieldJson}}) {{"}}"}}</template>
66+
</el-table-column> {{- else }}
67+
<el-table-column align="center" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120" />
68+
{{- end }}
69+
{{- end }}
70+
<el-table-column align="center" label="按钮组">
71+
<template #default="scope">
72+
<el-button type="text" icon="el-icon-edit" size="small" class="table-button" @click="update{{.StructName}}(scope.row)">变更</el-button>
73+
<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
74+
</template>
75+
</el-table-column>
76+
</el-table>
77+
<div class="gva-pagination">
78+
<el-pagination
79+
layout="total, sizes, prev, pager, next, jumper"
80+
:current-page="page"
81+
:page-size="pageSize"
82+
:page-sizes="[10, 30, 50, 100]"
83+
:total="total"
84+
@current-change="handleCurrentChange"
85+
@size-change="handleSizeChange"
86+
/>
87+
</div>
88+
</div>
8489
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
8590
<el-form :model="formData" label-position="right" label-width="80px">
8691
{{- range .Fields}}
@@ -93,26 +98,26 @@
9398
{{- end }}
9499
{{- if eq .FieldType "int" }}
95100
{{- if .DictType}}
96-
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" clearable>
101+
<el-select v-model="formData.{{ .FieldJson }}" placeholder="请选择" style="width:100%" clearable>
97102
<el-option v-for="(item,key) in {{ .DictType }}Options" :key="key" :label="item.label" :value="item.value" />
98103
</el-select>
99104
{{- else }}
100105
<el-input v-model.number="formData.{{ .FieldJson }}" clearable placeholder="请输入" />
101106
{{- end }}
102107
{{- end }}
103108
{{- if eq .FieldType "time.Time" }}
104-
<el-date-picker v-model="formData.{{ .FieldJson }}" type="date" placeholder="选择日期" clearable />
109+
<el-date-picker v-model="formData.{{ .FieldJson }}" type="date" style="width:100%" placeholder="选择日期" clearable />
105110
{{- end }}
106111
{{- if eq .FieldType "float64" }}
107-
<el-input-number v-model="formData.{{ .FieldJson }}" :precision="2" clearable />
112+
<el-input-number v-model="formData.{{ .FieldJson }}" style="width:100%" :precision="2" clearable />
108113
{{- end }}
109114
</el-form-item>
110115
{{- end }}
111116
</el-form>
112117
<template #footer>
113118
<div class="dialog-footer">
114-
<el-button @click="closeDialog">取 消</el-button>
115-
<el-button type="primary" @click="enterDialog">确 定</el-button>
119+
<el-button size="small" @click="closeDialog">取 消</el-button>
120+
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
116121
</div>
117122
</template>
118123
</el-dialog>
@@ -174,6 +179,9 @@ export default {
174179
{{- end }}
175180
},
176181
methods: {
182+
onReset() {
183+
this.searchInfo = {}
184+
},
177185
// 条件搜索前端看此方法
178186
onSubmit() {
179187
this.page = 1

server/router/autocode/autocodeExample.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ type AutoCodeExampleRouter struct {
1111

1212
func (s *AutoCodeExampleRouter) InitSysAutoCodeExampleRouter(Router *gin.RouterGroup) {
1313
autoCodeExampleRouter := Router.Group("autoCodeExample").Use(middleware.OperationRecord())
14+
autoCodeExampleRouterWithoutRecord := Router.Group("autoCodeExample")
1415
var autoCodeExampleApi = v1.ApiGroupApp.AutoCodeApiGroup.AutoCodeExampleApi
1516
{
1617
autoCodeExampleRouter.POST("createSysAutoCodeExample", autoCodeExampleApi.CreateAutoCodeExample) // 新建AutoCodeExample
1718
autoCodeExampleRouter.DELETE("deleteSysAutoCodeExample", autoCodeExampleApi.DeleteAutoCodeExample) // 删除AutoCodeExample
1819
autoCodeExampleRouter.PUT("updateSysAutoCodeExample", autoCodeExampleApi.UpdateAutoCodeExample) // 更新AutoCodeExample
19-
autoCodeExampleRouter.GET("findSysAutoCodeExample", autoCodeExampleApi.FindAutoCodeExample) // 根据ID获取AutoCodeExample
20-
autoCodeExampleRouter.GET("getSysAutoCodeExampleList", autoCodeExampleApi.GetAutoCodeExampleList) // 获取AutoCodeExample列表
20+
}
21+
{
22+
autoCodeExampleRouterWithoutRecord.GET("findSysAutoCodeExample", autoCodeExampleApi.FindAutoCodeExample) // 根据ID获取AutoCodeExample
23+
autoCodeExampleRouterWithoutRecord.GET("getSysAutoCodeExampleList", autoCodeExampleApi.GetAutoCodeExampleList) // 获取AutoCodeExample列表
2124
}
2225
}

server/router/example/exa_customer.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ type CustomerRouter struct {
1111

1212
func (e *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) {
1313
customerRouter := Router.Group("customer").Use(middleware.OperationRecord())
14+
customerRouterWithoutRecord := Router.Group("customer")
1415
var exaCustomerApi = v1.ApiGroupApp.ExampleApiGroup.CustomerApi
1516
{
16-
customerRouter.POST("customer", exaCustomerApi.CreateExaCustomer) // 创建客户
17-
customerRouter.PUT("customer", exaCustomerApi.UpdateExaCustomer) // 更新客户
18-
customerRouter.DELETE("customer", exaCustomerApi.DeleteExaCustomer) // 删除客户
19-
customerRouter.GET("customer", exaCustomerApi.GetExaCustomer) // 获取单一客户信息
20-
customerRouter.GET("customerList", exaCustomerApi.GetExaCustomerList) // 获取客户列表
17+
customerRouter.POST("customer", exaCustomerApi.CreateExaCustomer) // 创建客户
18+
customerRouter.PUT("customer", exaCustomerApi.UpdateExaCustomer) // 更新客户
19+
customerRouter.DELETE("customer", exaCustomerApi.DeleteExaCustomer) // 删除客户
20+
}
21+
{
22+
customerRouterWithoutRecord.GET("customer", exaCustomerApi.GetExaCustomer) // 获取单一客户信息
23+
customerRouterWithoutRecord.GET("customerList", exaCustomerApi.GetExaCustomerList) // 获取客户列表
2124
}
2225
}

server/router/example/exa_excel.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ func (e *ExcelRouter) InitExcelRouter(Router *gin.RouterGroup) {
1212
excelRouter := Router.Group("excel")
1313
var exaExcelApi = v1.ApiGroupApp.ExampleApiGroup.ExcelApi
1414
{
15-
excelRouter.POST("/importExcel", exaExcelApi.ImportExcel) // 导入Excel
16-
excelRouter.GET("/loadExcel", exaExcelApi.LoadExcel) // 加载Excel数据
17-
excelRouter.POST("/exportExcel", exaExcelApi.ExportExcel) // 导出Excel
18-
excelRouter.GET("/downloadTemplate", exaExcelApi.DownloadTemplate) // 下载模板文件
15+
excelRouter.POST("importExcel", exaExcelApi.ImportExcel) // 导入Excel
16+
excelRouter.GET("loadExcel", exaExcelApi.LoadExcel) // 加载Excel数据
17+
excelRouter.POST("exportExcel", exaExcelApi.ExportExcel) // 导出Excel
18+
excelRouter.GET("downloadTemplate", exaExcelApi.DownloadTemplate) // 下载模板文件
1919
}
2020
}

server/router/example/exa_file_upload_and_download.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gi
1212
fileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
1313
var exaFileUploadAndDownloadApi = v1.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
1414
{
15-
fileUploadAndDownloadRouter.POST("/upload", exaFileUploadAndDownloadApi.UploadFile) // 上传文件
16-
fileUploadAndDownloadRouter.POST("/getFileList", exaFileUploadAndDownloadApi.GetFileList) // 获取上传文件列表
17-
fileUploadAndDownloadRouter.POST("/deleteFile", exaFileUploadAndDownloadApi.DeleteFile) // 删除指定文件
18-
fileUploadAndDownloadRouter.POST("/breakpointContinue", exaFileUploadAndDownloadApi.BreakpointContinue) // 断点续传
19-
fileUploadAndDownloadRouter.GET("/findFile", exaFileUploadAndDownloadApi.FindFile) // 查询当前文件成功的切片
20-
fileUploadAndDownloadRouter.POST("/breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 查询当前文件成功的切片
21-
fileUploadAndDownloadRouter.POST("/removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 查询当前文件成功的切片
15+
fileUploadAndDownloadRouter.POST("upload", exaFileUploadAndDownloadApi.UploadFile) // 上传文件
16+
fileUploadAndDownloadRouter.POST("getFileList", exaFileUploadAndDownloadApi.GetFileList) // 获取上传文件列表
17+
fileUploadAndDownloadRouter.POST("deleteFile", exaFileUploadAndDownloadApi.DeleteFile) // 删除指定文件
18+
fileUploadAndDownloadRouter.POST("breakpointContinue", exaFileUploadAndDownloadApi.BreakpointContinue) // 断点续传
19+
fileUploadAndDownloadRouter.GET("findFile", exaFileUploadAndDownloadApi.FindFile) // 查询当前文件成功的切片
20+
fileUploadAndDownloadRouter.POST("breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 查询当前文件成功的切片
21+
fileUploadAndDownloadRouter.POST("removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 查询当前文件成功的切片
2222
}
2323
}

0 commit comments

Comments
 (0)