增加普通时间类型,以及增加富文本类型

This commit is contained in:
hoteas 2022-04-25 19:58:49 +08:00
parent c3d0c8921b
commit 79d1189803
5 changed files with 38 additions and 7275 deletions

View File

@ -64,6 +64,8 @@ var ColumnNameType = []ColumnShow{
{"idcard", false, true, true, false, "", false},
{"id", true, false, true, false, "", true},
{"parent_id", true, true, true, false, "", true},
{"content", false, false, false, false, "textArea", false},
{"info", false, true, true, false, "textArea", false},
//"sn"{true,true,true,""},
{"status", true, true, true, false, "select", false},
{"state", true, true, true, false, "select", false},
@ -78,7 +80,7 @@ var ColumnNameType = []ColumnShow{
{"index", false, false, false, false, "index", false},
{"password", false, true, false, false, "password", false},
{"pwd", false, true, false, false, "password", false},
{"info", false, true, true, false, "", false},
{"version", false, false, false, false, "", false},
{"seq", false, true, true, false, "", false},
{"sort", false, true, true, false, "", false},

View File

@ -236,7 +236,6 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
coloum["label"] = coloum.GetString("label")[:indexNum]
}
for _, ColumnName := range that.RuleConfig {
if (ColumnName.GetBool("strict") && coloum.GetString("name") == ColumnName.GetString("name")) ||
(!ColumnName.GetBool("strict") && strings.Contains(coloum.GetString("name"), ColumnName.GetString("name"))) {
@ -266,8 +265,12 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
}
if ColumnName.GetString("type") != "" {
if ColumnName.GetString("type") == "time" && coloum["type"] == "number" {
coloum["type"] = "unixTime"
} else {
coloum["type"] = ColumnName.GetString("type")
}
}
if ColumnName.GetBool("strict") && coloum.GetString("name") == ColumnName.GetString("name") {
break
}
@ -509,8 +512,17 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
v["value"] = "label"
continue
}
tempC := that.TableConfig.GetMap(tableName).GetSlice("columns")
isGet := true
for k2, _ := range tempC {
if strings.Contains(tempC.GetMap(k2).GetString("name"), "name") {
v["value"] = tempC.GetMap(k2).GetString("name")
isGet = false
break
}
}
if len(that.TableConfig.GetMap(tableName).GetSlice("columns")) > 2 {
if isGet && len(that.TableConfig.GetMap(tableName).GetSlice("columns")) > 2 {
v["value"] = that.TableConfig.GetMap(tableName).GetSlice("columns").GetMap(1).GetString("name")
continue
}
@ -666,13 +678,23 @@ func (that *MakeCode) Add(table string,user Map, req *http.Request) Map {
}
if v.GetString("name") == "create_time" {
if v.GetString("type") == "unixTime" {
data[v.GetString("name")] = time.Now().Unix()
}
if v.GetString("type") == "time" {
data[v.GetString("name")] = time.Now().Format("2006-01-02 15-04-05")
}
continue
}
if v.GetString("name") == "modify_time" {
if v.GetString("type") == "unixTime" {
data[v.GetString("name")] = time.Now().Unix()
}
if v.GetString("type") == "time" {
data[v.GetString("name")] = time.Now().Format("2006-01-02 15-04-05")
}
}
}
if len(data) == 0 {
return nil
@ -764,7 +786,6 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
v.GetString("link") + "." + v.GetString("value") + " AS " +
v.GetString("link") + "_" + v.GetString("name") + "_" + v.GetString("value") + ","
if that.TableColumns[v.GetString("link")]["phone"] != nil {
reStr += table + "." + v.GetString("name") + "," +
v.GetString("link") + ".phone AS " +

File diff suppressed because it is too large Load Diff

View File

@ -1,344 +0,0 @@
[
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "idcard",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "parent_id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "status",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "state",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "sex",
"strict": false,
"type": "select"
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "delete",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lat",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lng",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "latitude",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "longitude",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "index",
"strict": false,
"type": "index"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "password",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "pwd",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "info",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "version",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "seq",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "sort",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "note",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "description",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "abstract",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "content",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "address",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "full_name",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "create_time",
"strict": true,
"type": "time"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "modify_time",
"strict": true,
"type": "time"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "image",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "img",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "icon",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "avatar",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "file",
"strict": false,
"type": "file"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "age",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "email",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "time",
"strict": false,
"type": "time"
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "level",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "rule",
"strict": false,
"type": "form"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table",
"strict": false,
"type": "table"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table_id",
"strict": false,
"type": "table_id"
}
]

Binary file not shown.