diff --git a/server/resource/template/web/form.vue.tpl b/server/resource/template/web/form.vue.tpl index c3486c137cc2cf92963aa831a2ab06041c900b55..dc607dae8967dc0926f73eb8fdbccc459cb835be 100644 --- a/server/resource/template/web/form.vue.tpl +++ b/server/resource/template/web/form.vue.tpl @@ -63,7 +63,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType }} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), diff --git a/server/resource/template/web/table.vue.tpl b/server/resource/template/web/table.vue.tpl index 5b0c1fa52eaa141a4aeead5753ccb59316dbda99..2999607e915190cc441f538b9f11be1fdf00693e 100644 --- a/server/resource/template/web/table.vue.tpl +++ b/server/resource/template/web/table.vue.tpl @@ -158,7 +158,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType}} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), @@ -249,7 +249,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType }} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), diff --git a/server/service/system/sys_dictionary.go b/server/service/system/sys_dictionary.go index 4dfc960156f55d27e470c5064cc4c701aa7d6ca1..d2be5bfefc15c2e96dd85c4f3dfbe144eb549b40 100644 --- a/server/service/system/sys_dictionary.go +++ b/server/service/system/sys_dictionary.go @@ -68,7 +68,7 @@ func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *s //@return: err error, sysDictionary model.SysDictionary func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint) (err error, sysDictionary system.SysDictionary) { - err = global.GVA_DB.Where("type = ? OR id = ?", Type, Id).Preload("SysDictionaryDetails").First(&sysDictionary).Error + err = global.GVA_DB.Where("type = ? OR id = ? and status = ?", Type, Id, true).Preload("SysDictionaryDetails", "status = ?", true).First(&sysDictionary).Error return } diff --git a/server/source/dictionary_details.go b/server/source/dictionary_details.go index 96066a32ff1a1a7574b43f3ace061f1c1094e09c..254fbe5e03d867c7bae72b1fd01e864413c60281 100644 --- a/server/source/dictionary_details.go +++ b/server/source/dictionary_details.go @@ -41,6 +41,8 @@ func (d *dictionaryDetail) Init() error { {global.GVA_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longblob", 8, status, 8, 5}, {global.GVA_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longtext", 9, status, 9, 5}, {global.GVA_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "tinyint", 0, status, 0, 6}, + {global.GVA_MODEL{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "男", 0, status, 0, 1}, + {global.GVA_MODEL{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "女", 1, status, 1, 1}, } return global.GVA_DB.Transaction(func(tx *gorm.DB) error { if tx.Where("id IN ?", []int{1, 23}).Find(&[]system.SysDictionaryDetail{}).RowsAffected == 2 { diff --git a/web/src/view/dashboard/dashbordCharts/echartsLine.vue b/web/src/view/dashboard/dashbordCharts/echartsLine.vue index 6e2f5055666c9ba9448c153105c379d99661f342..99270db8066cd3a17edea0a7a9a43c9751fdc545 100644 --- a/web/src/view/dashboard/dashbordCharts/echartsLine.vue +++ b/web/src/view/dashboard/dashbordCharts/echartsLine.vue @@ -11,6 +11,7 @@