确定要删除吗?
@@ -136,7 +136,7 @@ import {
find{{.StructName}},
get{{.StructName}}List
} from "@/api/{{.PackageName}}"; // 此处请自行替换地址
-import { formatTimeToStr } from "@/utils/data";
+import { formatTimeToStr } from "@/utils/date";
import infoList from "@/mixins/infoList";
export default {
name: "{{.StructName}}",
diff --git a/server/resource/template/te/model.go.tpl b/server/resource/template/te/model.go.tpl
index 8708aef9..8394f70f 100644
--- a/server/resource/template/te/model.go.tpl
+++ b/server/resource/template/te/model.go.tpl
@@ -9,10 +9,10 @@ import (
type {{.StructName}} struct {
global.GVA_MODEL {{- range .Fields}}
{{- if eq .FieldType "bool" }}
- {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
+ {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
{{- else }}
- {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
- {{- end }} {{- end }}
+ {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
+ {{- end }} {{- end }}
}
{{ if .TableName }}
diff --git a/server/service/exa_simple_uploader.go b/server/service/exa_simple_uploader.go
index 25777c3d..ae2b783d 100644
--- a/server/service/exa_simple_uploader.go
+++ b/server/service/exa_simple_uploader.go
@@ -51,27 +51,26 @@ func MergeFileMd5(md5 string, fileName string) (err error) {
if err != nil {
return err
}
- //创建事务
- tx := global.GVA_DB.Begin()
- //删除切片信息
- err = tx.Delete(&model.ExaSimpleUploader{}, "identifier = ? AND is_done = ?", md5, false).Error
- // 添加文件信息
- if err != nil {
- fmt.Println(err)
- tx.Rollback()
- }
- err = tx.Create(&model.ExaSimpleUploader{
- Identifier: md5,
- IsDone: true,
- FilePath: finishDir + fileName,
- Filename: fileName,
- }).Error
- if err != nil {
- fmt.Println(err)
- tx.Rollback()
- }
- tx.Commit()
- //清除切片
- err = os.RemoveAll(dir)
- return
+ err = global.GVA_DB.Transaction(func(tx *gorm.DB) error {
+ //删除切片信息
+ if err = tx.Delete(&model.ExaSimpleUploader{}, "identifier = ? AND is_done = ?", md5, false).Error; err != nil {
+ fmt.Println(err)
+ return err
+ }
+ data := model.ExaSimpleUploader{
+ Identifier: md5,
+ IsDone: true,
+ FilePath: finishDir + fileName,
+ Filename: fileName,
+ }
+ // 添加文件信息
+ if err = tx.Create(&data).Error; err != nil {
+ fmt.Println(err)
+ return err
+ }
+ return nil
+ })
+
+ err = os.RemoveAll(dir) //清除切片
+ return err
}
diff --git a/web/src/style/main.scss b/web/src/style/main.scss
index 01afb9e8..a6f36f7e 100644
--- a/web/src/style/main.scss
+++ b/web/src/style/main.scss
@@ -1026,4 +1026,9 @@ li {
color: #606266;
cursor: pointer;
font-size: 13px;
+}
+
+
+.table-button{
+ margin-right:8px !important;
}
\ No newline at end of file
diff --git a/web/src/view/systemTools/autoCode/component/fieldDialog.vue b/web/src/view/systemTools/autoCode/component/fieldDialog.vue
index 2e2a6fa1..dfb2552a 100644
--- a/web/src/view/systemTools/autoCode/component/fieldDialog.vue
+++ b/web/src/view/systemTools/autoCode/component/fieldDialog.vue
@@ -195,7 +195,6 @@ export default {
}
},
async created() {
- this.getDbfdOptions();
const dictRes = await getSysDictionaryList({
page: 1,
pageSize: 999999