Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e99fe70
Update table.vue.tpl
zayn-code Nov 5, 2024
0d84ea9
Update form.vue.tpl
zayn-code Nov 5, 2024
b2cfbb9
fix: 在导出表格之前取消掉用户自行添加的""和``
piexlmax Nov 6, 2024
e75fa0b
feat: 更换代码编辑器,增加不同node的兼容性。
piexlmax Nov 7, 2024
e6d203d
fix: AI生成代码强制处理首字母大写,提高容错
pixelmaxQm Nov 7, 2024
c4c5f01
feat: 增加包ace-builds
pixelmaxQm Nov 7, 2024
5604424
Merge pull request #1924 from zayn-code/main
pixelmaxQm Nov 8, 2024
35fd5c8
feat: 更新dockerfile的node版本
piexlmax Nov 8, 2024
d8e36ab
feat: 新增方法默认窗口关闭
piexlmax Nov 9, 2024
fae6f41
fix: 适配 eslint v9 更新, 兼容低版本 node (#1930)
Raindrop-YL Nov 9, 2024
87a4ce1
feat: 根据eslint 对项目进行规范化处理
piexlmax Nov 9, 2024
7d9af64
feat: 使用prettierrc对代码进行格式化
piexlmax Nov 9, 2024
f638035
perf(projects): 增强文件校验的兼容性 (#1931)
Azir-11 Nov 10, 2024
710257d
delete: 删除开发模式docker-compose环境
pixelmaxQm Nov 10, 2024
5820437
Update README.md
pixelmaxQm Nov 10, 2024
fbd0f4b
fix: 自动化代码需检测简称,简称不可以重复。
pixelmaxQm Nov 11, 2024
51e1c62
web/src/view/superAdmin/menu/icon.vue: 后台菜单管理中选择图标时增加可选自定义图标 (#1933)
c4zo Nov 12, 2024
a9894ac
feat: 允许清除关联关系
pixelmaxQm Nov 14, 2024
f7889b9
Update format.js (#1935)
zayn-code Nov 15, 2024
b954457
Update date.js (#1937)
tesun Nov 16, 2024
4671013
fix: 自动化代码回滚后不可复用的bug
pixelmaxQm Nov 17, 2024
8073e98
查询不重置pageSize (#1940)
zayn-code Nov 18, 2024
c909d32
fix: 无法自动化新增字段的bug
pixelmaxQm Nov 19, 2024
3921266
feat: 修复导出在baseApi配置为/时候的路径拼接错误
pixelmaxQm Nov 21, 2024
d72984b
修复 dockerfile 添加缓存层 (#1943)
bypanghu Nov 25, 2024
8d2735f
解决Invalid vnode type when creating vnode的警告问题
neo-6 Dec 2, 2024
6bfbfc4
解决传参时提示错误警告
neo-6 Dec 2, 2024
3272f3c
修复长度验证中数字验证
neo-6 Dec 2, 2024
80c54ad
Merge pull request #1946 from neo-6/neo-6-patch-1
pixelmaxQm Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@

[English](./README-en.md) | 简体中文

## ✨一分钟生成前后端基础代码

<table>
<tr>
<td width="200">
<p>📄 创建基础模板</p>
<p>🤖 AI生成结构</p>
<p>⏰ 生成代码</p>
<p>🏷️ 分配权限</p>
<p>🎉 基础CURD生成完成</p>
</td>
<td>
<video src="https://private-user-images.githubusercontent.com/165128580/384700666-4d039215-af29-4f86-bb4f-60dbab38f58e.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzEyNTIxNDYsIm5iZiI6MTczMTI1MTg0NiwicGF0aCI6Ii8xNjUxMjg1ODAvMzg0NzAwNjY2LTRkMDM5MjE1LWFmMjktNGY4Ni1iYjRmLTYwZGJhYjM4ZjU4ZS5tcDQ_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTExMFQxNTE3MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjJkMDcwZjJkMjAyMmU1N2I2MzQxY2RhODFlNzgzNGRiMDFhMmY2NTYyM2ZmODdhNDVmMWE1NzlhMDdlOTI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ZJbswpLzF2RHjemcGirKOP0L1fvpl3FUqIiQ_-yjeUo" data-canonical-src="https://private-user-images.githubusercontent.com/165128580/384700666-4d039215-af29-4f86-bb4f-60dbab38f58e.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzEyNTIxNDYsIm5iZiI6MTczMTI1MTg0NiwicGF0aCI6Ii8xNjUxMjg1ODAvMzg0NzAwNjY2LTRkMDM5MjE1LWFmMjktNGY4Ni1iYjRmLTYwZGJhYjM4ZjU4ZS5tcDQ_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTExMFQxNTE3MjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjJkMDcwZjJkMjAyMmU1N2I2MzQxY2RhODFlNzgzNGRiMDFhMmY2NTYyM2ZmODdhNDVmMWE1NzlhMDdlOTI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ZJbswpLzF2RHjemcGirKOP0L1fvpl3FUqIiQ_-yjeUo" controls="controls" muted="muted" class="d-block rounded-bottom-2 border-top width-fit" style="max-height:640px; min-height: 200px">
</video>
</td>
</tr>
</table>


# 项目文档
[在线文档](https://www.gin-vue-admin.com) : https://www.gin-vue-admin.com

Expand Down
99 changes: 0 additions & 99 deletions deploy/docker-compose/docker-compose-dev.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions server/api/v1/system/auto_code_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (a *AutoCodeTemplateApi) Preview(c *gin.Context) {
info.PackageT = utils.FirstUpper(info.Package)
autoCode, err := autoCodeTemplateService.Preview(c.Request.Context(), info)
if err != nil {
global.GVA_LOG.Error("预览失败!", zap.Error(err))
response.FailWithMessage("预览失败", c)
global.GVA_LOG.Error(err.Error(), zap.Error(err))
response.FailWithMessage("预览失败:"+err.Error(), c)
} else {
response.OkWithDetailed(gin.H{"autoCode": autoCode}, "预览成功", c)
}
Expand Down
1 change: 1 addition & 0 deletions server/model/system/request/sys_auto_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func (r *SysAutoHistoryCreate) Create() model.SysAutoCodeHistory {
Request: r.Request,
Table: r.Table,
StructName: r.StructName,
Abbreviation: r.StructName,
BusinessDB: r.BusinessDB,
Description: r.Description,
Injections: r.Injections,
Expand Down
1 change: 1 addition & 0 deletions server/model/system/sys_auto_code_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type SysAutoCodeHistory struct {
Package string `json:"package" gorm:"column:package;comment:模块名/插件名"`
Request string `json:"request" gorm:"type:text;column:request;comment:前端传入的结构化信息"`
StructName string `json:"structName" gorm:"column:struct_name;comment:结构体名称"`
Abbreviation string `json:"abbreviation" gorm:"column:abbreviation;comment:结构体名称缩写"`
BusinessDB string `json:"businessDb" gorm:"column:business_db;comment:业务库"`
Description string `json:"description" gorm:"column:description;comment:Struct中文名称"`
Templates map[string]string `json:"template" gorm:"serializer:json;type:text;column:templates;comment:模板信息"`
Expand Down
11 changes: 8 additions & 3 deletions server/resource/package/web/view/form.vue.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ getDataSourceFunc()
{{- end }}
{{- end }}
<el-form-item>
<el-button type="primary" @click="save">保存</el-button>
<el-button :loading="btnLoading" type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="back">返回</el-button>
</el-form-item>
</el-form>
Expand Down Expand Up @@ -277,6 +277,9 @@ import ArrayCtrl from '@/components/arrayCtrl/arrayCtrl.vue'
const route = useRoute()
const router = useRouter()

// 提交按钮loading
const btnLoading = ref(false)

const type = ref('')
{{- range $index, $element := .DictTypes}}
const {{ $element }}Options = ref([])
Expand Down Expand Up @@ -369,8 +372,9 @@ const init = async () => {
init()
// 保存按钮
const save = async() => {
btnLoading.value = true
elFormRef.value?.validate( async (valid) => {
if (!valid) return
if (!valid) return btnLoading.value = false
let res
switch (type.value) {
case 'create':
Expand All @@ -383,6 +387,7 @@ const save = async() => {
res = await create{{.StructName}}(formData.value)
break
}
btnLoading.value = false
if (res.code === 0) {
ElMessage({
type: 'success',
Expand Down Expand Up @@ -410,4 +415,4 @@ const back = () => {
<style>
</style>
{{- end }}
{{- end }}
{{- end }}
50 changes: 37 additions & 13 deletions server/resource/package/web/view/table.vue.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
{{- if .CheckDataSource }}
<el-table-column {{- if .Sort}} sortable{{- end}} align="left" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<template #default="scope">
{{if eq .DataSource.Association 2}}
{{- if eq .DataSource.Association 2}}
<el-tag v-for="(item,key) in filterDataSource(dataSource.{{.FieldJson}},scope.row.{{.FieldJson}})" :key="key">
{{ "{{ item }}" }}
</el-tag>
{{ else }}
{{- else }}
<span>{{"{{"}} filterDataSource(dataSource.{{.FieldJson}},scope.row.{{.FieldJson}}) {{"}}"}}</span>
{{ end }}
{{- end }}
</template>
</el-table-column>
{{- else if .DictType}}
Expand Down Expand Up @@ -232,7 +232,17 @@
{{- range .Fields}}
{{- if .Desc }}
<el-descriptions-item label="{{ .FieldDesc }}">
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
{{- if .CheckDataSource }}
<template #default="scope">
{{- if eq .DataSource.Association 2}}
<el-tag v-for="(item,key) in filterDataSource(dataSource.{{.FieldJson}},detailFrom.{{.FieldJson}})" :key="key">
{{ "{{ item }}" }}
</el-tag>
{{- else }}
<span>{{"{{"}} filterDataSource(dataSource.{{.FieldJson}},detailFrom.{{.FieldJson}}) {{"}}"}}</span>
{{- end }}
</template>
{{- else if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
{{"{{"}} detailFrom.{{.FieldJson}} {{"}}"}}
{{- else }}
{{- if eq .FieldType "picture" }}
Expand Down Expand Up @@ -338,7 +348,7 @@ const {{ $element }}Options = ref([])
get{{.StructName}}DataSource,

// 获取数据源
const dataSource = ref([])
const dataSource = ref({})
const getDataSourceFunc = async()=>{
const res = await get{{.StructName}}DataSource()
if (res.code === 0) {
Expand Down Expand Up @@ -537,13 +547,13 @@ getDataSourceFunc()
{{- if .CheckDataSource }}
<el-table-column {{- if .Sort}} sortable{{- end}} align="left" label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="120">
<template #default="scope">
{{if eq .DataSource.Association 2}}
{{- if eq .DataSource.Association 2}}
<el-tag v-for="(item,key) in filterDataSource(dataSource.{{.FieldJson}},scope.row.{{.FieldJson}})" :key="key">
{{ "{{ item }}" }}
</el-tag>
{{ else }}
{{- else }}
<span>{{"{{"}} filterDataSource(dataSource.{{.FieldJson}},scope.row.{{.FieldJson}}) {{"}}"}}</span>
{{ end }}
{{- end }}
</template>
</el-table-column>
{{- else if .DictType}}
Expand Down Expand Up @@ -642,7 +652,7 @@ getDataSourceFunc()
<div class="flex justify-between items-center">
<span class="text-lg">{{"{{"}}type==='create'?'新增':'编辑'{{"}}"}}</span>
<div>
<el-button type="primary" @click="enterDialog">确 定</el-button>
<el-button :loading="btnLoading" type="primary" @click="enterDialog">确 定</el-button>
<el-button @click="closeDialog">取 消</el-button>
</div>
</div>
Expand Down Expand Up @@ -727,7 +737,17 @@ getDataSourceFunc()
{{- range .Fields}}
{{- if .Desc }}
<el-descriptions-item label="{{ .FieldDesc }}">
{{- if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
{{- if .CheckDataSource }}
<template #default="scope">
{{- if eq .DataSource.Association 2}}
<el-tag v-for="(item,key) in filterDataSource(dataSource.{{.FieldJson}},detailFrom.{{.FieldJson}})" :key="key">
{{ "{{ item }}" }}
</el-tag>
{{- else }}
<span>{{"{{"}} filterDataSource(dataSource.{{.FieldJson}},detailFrom.{{.FieldJson}}) {{"}}"}}</span>
{{- end }}
</template>
{{- else if and (ne .FieldType "picture" ) (ne .FieldType "pictures" ) (ne .FieldType "file" ) (ne .FieldType "array" ) }}
{{"{{"}} detailFrom.{{.FieldJson}} {{"}}"}}
{{- else }}
{{- if eq .FieldType "picture" }}
Expand Down Expand Up @@ -821,6 +841,9 @@ defineOptions({
const btnAuth = useBtnAuth()
{{- end }}

// 提交按钮loading
const btnLoading = ref(false)

// 控制更多查询条件显示/隐藏状态
const showAllQuery = ref(false)

Expand Down Expand Up @@ -987,7 +1010,6 @@ const onSubmit = () => {
elSearchFormRef.value?.validate(async(valid) => {
if (!valid) return
page.value = 1
pageSize.value = 10
{{- range .Fields}}{{- if eq .FieldType "bool" }}
if (searchInfo.value.{{.FieldJson}} === ""){
searchInfo.value.{{.FieldJson}}=null
Expand Down Expand Up @@ -1171,8 +1193,9 @@ const closeDialog = () => {
}
// 弹窗确定
const enterDialog = async () => {
btnLoading.value = true
elFormRef.value?.validate( async (valid) => {
if (!valid) return
if (!valid) return btnLoading.value = false
let res
switch (type.value) {
case 'create':
Expand All @@ -1185,6 +1208,7 @@ const enterDialog = async () => {
res = await create{{.StructName}}(formData.value)
break
}
btnLoading.value = false
if (res.code === 0) {
ElMessage({
type: 'success',
Expand Down Expand Up @@ -1263,4 +1287,4 @@ defineOptions({
</style>
{{- end }}

{{- end }}
{{- end }}
Loading