Browse Source

修改窜梭框字段属性

li_v1
hreenshan112 1 year ago
parent
commit
fc480b7b48
  1. 29
      api/version1/customerApp/appControll.go
  2. 128
      api/version1/customerform/formTable.go
  3. 135
      api/version1/customerform/formTableView.go
  4. 16
      api/version1/taskplatform/taskmanagement/ruanTask.go
  5. 17
      api/version1/taskplatform/taskmanagement/runTaskFlow.go
  6. 18
      overall/publicmethod/technique.go

29
api/version1/customerApp/appControll.go

@ -1189,8 +1189,14 @@ func ListFields(list string, ComponentList []customerform.MasterStruct) (listStr
var fileAry []interface{} var fileAry []interface{}
for _, v := range searchDataAry { for _, v := range searchDataAry {
// fmt.Printf("处理列表字段名称变更:%v\n", v)
fieldKey, isTrue := WordToFile(v, ComponentList)
// WordToFile(v,ComponentList) // WordToFile(v,ComponentList)
fileAry = append(fileAry, WordToFile(v, ComponentList)) if isTrue {
fileAry = append(fileAry, fieldKey)
}
} }
searchMap["searchData"] = fileAry searchMap["searchData"] = fileAry
@ -1204,7 +1210,10 @@ func ListFields(list string, ComponentList []customerform.MasterStruct) (listStr
if columnsAry, isOk := columns.([]interface{}); isOk { if columnsAry, isOk := columns.([]interface{}); isOk {
var fileTableAry []interface{} var fileTableAry []interface{}
for _, v := range columnsAry { for _, v := range columnsAry {
fileTableAry = append(fileTableAry, WordToFile(v, ComponentList)) fieldKey, isTrue := WordToFile(v, ComponentList)
if isTrue {
fileTableAry = append(fileTableAry, fieldKey)
}
} }
tableMapInfo["columns"] = fileTableAry tableMapInfo["columns"] = fileTableAry
} }
@ -1234,28 +1243,34 @@ func ListFields(list string, ComponentList []customerform.MasterStruct) (listStr
@ 时间: 2024-09-14 08:46:39 @ 时间: 2024-09-14 08:46:39
@ 功能: 字段比对 @ 功能: 字段比对
*/ */
func WordToFile(filedInfo interface{}, ComponentList []customerform.MasterStruct) interface{} { func WordToFile(filedInfo interface{}, ComponentList []customerform.MasterStruct) (interface{}, bool) {
// var fileName string // var fileName string
// filedMap := publicmethod.MapOut[string]() // filedMap := publicmethod.MapOut[string]()
isTrue := false
if filedMap, isOk := filedInfo.(map[string]interface{}); isOk { if filedMap, isOk := filedInfo.(map[string]interface{}); isOk {
if fileNames, isok := filedMap["id"]; isok { if fileNames, isok := filedMap["id"]; isok {
if fliedString, isOk := fileNames.(string); isOk { if fliedString, isOk := fileNames.(string); isOk {
// fileName = fliedString // fileName = fliedString
if publicmethod.IsInTrue[string](fliedString, []string{"checkbox", "serialNumber", "operate", "id", "masters_key", "creater", "creater_time", "edit_time", "flow_id", "states", "flowIsOpen"}) {
// fmt.Printf("搜索列表字段-4->%T-->%v\n", fileName, fileName) isTrue = true
} else {
for _, v := range ComponentList { for _, v := range ComponentList {
if v.Name == fliedString { if v.Name == fliedString {
// fmt.Printf("搜索列表字段-5->%T-->%v\n", v.Item.Label, v.Item.Label) // fmt.Printf("搜索列表字段-5->%T-->%v\n", v.Item.Label, v.Item.Label)
filedMap["label"] = v.Item.Label filedMap["label"] = v.Item.Label
isTrue = true
}
} }
} }
fmt.Printf("搜索列表字段-4->%T-->%v\n", fliedString, fliedString)
// fmt.Printf("搜索列表字段-6->%T-->%v\n", filedMap, filedMap) // fmt.Printf("搜索列表字段-6->%T-->%v\n", filedMap, filedMap)
return filedMap return filedMap, isTrue
} }
} }
} }
return filedInfo return filedInfo, isTrue
} }
/* /*

128
api/version1/customerform/formTable.go

@ -158,7 +158,7 @@ func AnalysisFormUnitClass(subUnit MasterStruct) (fieldCont AnalysisFormSubUnitC
case "textarea", "tinymce": //多行文本,富文本 case "textarea", "tinymce": //多行文本,富文本
fieldCont.FieldType = "mediumtext" fieldCont.FieldType = "mediumtext"
case "signaturemap": case "signaturemap", "lowcodeTransfer":
fieldCont.FieldType = "longtext" fieldCont.FieldType = "longtext"
case "radio": //单选框组 case "radio": //单选框组
if subUnit.Config.TransformData == "number" || subUnit.Config.TransformData == "" { if subUnit.Config.TransformData == "number" || subUnit.Config.TransformData == "" {
@ -855,117 +855,13 @@ func TableFieldCompare(tableFieldList []Result, jsonFieldList []FormFieldInfo) (
titleInfo.InactiveValue = "" titleInfo.InactiveValue = ""
fieldList = append(fieldList, titleInfo) fieldList = append(fieldList, titleInfo)
} else { } else {
fieldList = append(fieldList, TableFormAttribute(v, jsonFieldList)) tableKey, isOk := TableFormAttribute(v, jsonFieldList)
if isOk {
fieldList = append(fieldList, tableKey)
} }
}
// if len(jsonFieldList) > 0 {
// var writeTableField []string
// for _, tv := range tableFieldList {
// for _, jv := range jsonFieldList {
// if tv.Field == jv.Id {
// if !publicmethod.IsInTrue[string](tv.Field, writeTableField) {
// writeTableField = append(writeTableField, tv.Field)
// }
// var fieldInfo FormFieldInfo
// fieldInfo.Id = jv.Id
// if tv.Comment == "" {
// fieldInfo.Label = jv.Label
// } else {
// fieldInfo.Label = tv.Comment
// }
// fieldInfo.Field = tv.Field //field"`
// attFiled := strings.Split(tv.Type, " ")
// // fmt.Printf("attFiled---->%v=========>%v\n", tv.Type, jv.Auxiliary)
// if len(attFiled) > 0 {
// fieldInfo.Types = attFiled[0]
// }
// if len(attFiled) >= 2 {
// fieldInfo.Attribute = attFiled[1]
// }
// patternInfo := strings.Split(tv.Type, "(")
// if len(patternInfo) >= 1 {
// fieldInfo.Pattern = patternInfo[0]
// }
// fieldInfo.Auxiliary = jv.Auxiliary
// fieldInfo.FieldClass = jv.FieldClass //fieldClass"`
// fieldInfo.ActiveValue = jv.ActiveValue //activeValue"`
// fieldInfo.InactiveValue = jv.InactiveValue //inactiveValue"`
// fieldInfo.Options = jv.Options //options"`
// fieldInfo.Control = jv.Control //control"`
// fieldInfo.Config = jv.Config //config"`
// fieldList = append(fieldList, fieldInfo)
// }
// }
// }
// if len(writeTableField) > 0 {
// for _, tv := range tableFieldList {
// if !publicmethod.IsInTrue[string](tv.Field, writeTableField) {
// var fieldInfo FormFieldInfo
// fieldInfo.Id = tv.Field
// if tv.Comment == "" {
// fieldInfo.Label = tv.Field
// } else {
// fieldInfo.Label = tv.Comment
// }
// fieldInfo.Field = tv.Field //field"`
// attFiled := strings.Split(tv.Type, " ")
// if len(attFiled) > 0 {
// fieldInfo.Types = attFiled[0]
// }
// if len(attFiled) >= 2 {
// fieldInfo.Attribute = attFiled[1]
// }
// patternInfo := strings.Split(tv.Type, "(")
// if len(patternInfo) >= 1 {
// fieldInfo.Pattern = patternInfo[0]
// }
// fieldInfo.FieldClass = tv.Field //fieldClass"` }
// // fieldInfo.ActiveValue = v. //activeValue"` }
// // fieldInfo.InactiveValue = v. //inactiveValue"`
// // fieldInfo.Options = v. //options"`
// fieldList = append(fieldList, fieldInfo)
// }
// }
// for _, jv := range jsonFieldList {
// if !publicmethod.IsInTrue[string](jv.Id, writeTableField) {
// fieldList = append(fieldList, jv)
// }
// }
// }
// } else {
// for _, v := range tableFieldList {
// var fieldInfo FormFieldInfo
// fieldInfo.Id = v.Field
// fieldInfo.Label = v.Comment
// fieldInfo.Field = v.Field //field"`
// attFiled := strings.Split(v.Type, " ")
// if len(attFiled) >= 2 {
// fieldInfo.Attribute = attFiled[1]
// fieldInfo.Types = attFiled[0]
// }
// patternInfo := strings.Split(v.Type, "(")
// if len(patternInfo) >= 1 {
// fieldInfo.Pattern = patternInfo[0]
// }
// // fieldInfo.FieldClass = v. //fieldClass"`
// // fieldInfo.ActiveValue = v. //activeValue"`
// // fieldInfo.InactiveValue = v. //inactiveValue"`
// // fieldInfo.Options = v. //options"`
// fieldList = append(fieldList, fieldInfo)
// }
// }
} else { } else {
fieldList = jsonFieldList fieldList = jsonFieldList
} }
@ -1519,9 +1415,17 @@ func (l *ListPageFields) DevelopSpecificationsSend(listData []map[string]interfa
} }
} }
case "timePicker": case "timePicker":
if timeVal, isOk := mv.(int64); isOk { timeVal, _ := publicmethod.StringToInt64(mv)
sendInfo[mi] = publicmethod.UnixTimeToDay(timeVal/1000, 6) if timeVal != 0 {
sendInfo[mi] = publicmethod.UnixTimeToDay(timeVal/1000, 5)
} else {
sendInfo[mi] = ""
} }
// if timeVal, isOk := mv.(int64); isOk {
// sendInfo[mi] = publicmethod.UnixTimeToDay(timeVal/1000, 6)
// }
// fmt.Printf("时间显示器:%T====》%v\n", mv, mv)
case "deptOrg": case "deptOrg":
var orgCont modelshr.AdministrativeOrganization var orgCont modelshr.AdministrativeOrganization
orgCont.GetCont(map[string]interface{}{"`id`": mv}, "`name`") orgCont.GetCont(map[string]interface{}{"`id`": mv}, "`name`")

135
api/version1/customerform/formTableView.go

@ -1110,14 +1110,15 @@ func (a *ApiMethod) GainFormPageMapCont(c *gin.Context) {
# #
*/ */
func TableFormAttribute(formField Result, tableFieldList []FormFieldInfo) (fieldInfo FormFieldInfo) { func TableFormAttribute(formField Result, tableFieldList []FormFieldInfo) (fieldInfo FormFieldInfo, isTrue bool) {
if len(tableFieldList) > 0 { if len(tableFieldList) > 0 {
fieldAry := strings.Split(formField.Field, "_end") fieldAry := strings.Split(formField.Field, "_end")
// fmt.Printf("字段数组----->%v----->%v\n", len(fieldAry), fieldAry) fmt.Printf("字段数组----->%v----->%v\n", len(fieldAry), fieldAry)
if len(fieldAry) >= 1 { if len(fieldAry) >= 1 {
isWrite := true isWrite := true
for _, v := range tableFieldList { for _, v := range tableFieldList {
if fieldAry[0] == v.Id { if fieldAry[0] == v.Id {
isTrue = true
isWrite = false isWrite = false
fieldInfo.Id = formField.Field fieldInfo.Id = formField.Field
if formField.Comment == "" { if formField.Comment == "" {
@ -1147,6 +1148,87 @@ func TableFormAttribute(formField Result, tableFieldList []FormFieldInfo) (field
} }
} }
if isWrite { if isWrite {
isTrue = true
// fieldInfo.Id = formField.Field
// fieldInfo.Label = formField.Comment
// fieldInfo.Field = formField.Field //field"`
// attFiled := strings.Split(formField.Type, " ")
// if len(attFiled) >= 2 {
// fieldInfo.Attribute = attFiled[1]
// fieldInfo.Types = attFiled[0]
// }
// patternInfo := strings.Split(formField.Type, "(")
// if len(patternInfo) >= 1 {
// fieldInfo.Pattern = patternInfo[0]
// }
fmt.Printf("字段数组---12-->%v----->%v\n", isWrite, formField)
switch formField.Field {
case "_lableTitle":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "id":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "masters_key":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "creater":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "creater_time":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "edit_time":
fieldInfo.Id = formField.Field fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"` fieldInfo.Field = formField.Field //field"`
@ -1159,9 +1241,58 @@ func TableFormAttribute(formField Result, tableFieldList []FormFieldInfo) (field
if len(patternInfo) >= 1 { if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0] fieldInfo.Pattern = patternInfo[0]
} }
case "flow_id":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "states":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
case "flowIsOpen":
fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment
fieldInfo.Field = formField.Field //field"`
attFiled := strings.Split(formField.Type, " ")
if len(attFiled) >= 2 {
fieldInfo.Attribute = attFiled[1]
fieldInfo.Types = attFiled[0]
}
patternInfo := strings.Split(formField.Type, "(")
if len(patternInfo) >= 1 {
fieldInfo.Pattern = patternInfo[0]
}
default:
isTrue = false
// formKey := TableFormAttributeForm(v, jsonFieldList)
// if formKey.Field != "" {
// fieldList = append(fieldList, formKey)
// }
}
} }
} }
} else { } else {
isTrue = true
// var fieldInfo FormFieldInfo // var fieldInfo FormFieldInfo
fieldInfo.Id = formField.Field fieldInfo.Id = formField.Field
fieldInfo.Label = formField.Comment fieldInfo.Label = formField.Comment

16
api/version1/taskplatform/taskmanagement/ruanTask.go

@ -197,7 +197,7 @@ func ChuLiMasterTableData(key string, val interface{}, unitCont []customerform.U
if uv.Key == key { if uv.Key == key {
acValInt, _ := strconv.Atoi(uv.ActiveValue) acValInt, _ := strconv.Atoi(uv.ActiveValue)
// InavalInt, _ := strconv.Atoi(uv.InactiveValue) // InavalInt, _ := strconv.Atoi(uv.InactiveValue)
fmt.Printf("switch---->%v-->%T---->%v\n", uv.Class, val, val)
switch uv.Class { switch uv.Class {
case "switch": case "switch":
// fmt.Printf("switch-->%T---->%v\n", val, val) // fmt.Printf("switch-->%T---->%v\n", val, val)
@ -295,7 +295,10 @@ func ChuLiMasterTableData(key string, val interface{}, unitCont []customerform.U
} }
} }
case "select": case "select":
if auxIsTeuw, isOk := uv.Auxiliary.(bool); isOk { if auxIsTeuw, isOk := uv.Auxiliary.(bool); isOk {
tj, _ := json.Marshal(tableFormInfo)
fmt.Printf("select---->%v---->%v-->%T---->%v---->%v\n", key, auxIsTeuw, val, val, string(tj))
if auxIsTeuw { if auxIsTeuw {
var ary []interface{} var ary []interface{}
if valStr, isTrue := val.(string); isTrue { if valStr, isTrue := val.(string); isTrue {
@ -305,6 +308,7 @@ func ChuLiMasterTableData(key string, val interface{}, unitCont []customerform.U
return val return val
} }
} else { } else {
fmt.Printf("select:%T--1-->%v\n", tableFormInfo, tableFormInfo)
valInt, _ := publicmethod.StringToInt64(val) valInt, _ := publicmethod.StringToInt64(val)
return valInt return valInt
} }
@ -314,6 +318,14 @@ func ChuLiMasterTableData(key string, val interface{}, unitCont []customerform.U
return valInt return valInt
} }
fmt.Printf("%v----->switch-->%T---->%v\n", key, uv, uv) fmt.Printf("%v----->switch-->%T---->%v\n", key, uv, uv)
case "timePicker":
// timeVal, _ := publicmethod.StringToInt64(val)
// val = publicmethod.UnixTimeToDay(timeVal/1000, 5)
case "expand-user":
// valStr := publicmethod.TypeToInterface(val)
// var peopleAry []string
// json.Unmarshal([]byte(valStr), &peopleAry)
// val = strings.Join(peopleAry, ",")
default: default:
return val return val
} }
@ -2348,7 +2360,7 @@ person_in_charge
*/ */
func GainOrgManager(orgId []int64) (UserList []OperatorList) { func GainOrgManager(orgId []int64) (UserList []OperatorList) {
var userInfoAry []modelshr.ManCont var userInfoAry []modelshr.ManCont
overall.CONSTANT_DB_HR.Model(&modelshr.ManCont{}).Select("`key`,`name`,`number`,`icon`,`icon_photo`,`wechat`,`work_wechat`,`admin_org`,`position`,`teamid`,`mobilephone`,`company`").Where("`admin_org` IN ? AND `person_in_charge` = ?", orgId, 1).Find(&userInfoAry) overall.CONSTANT_DB_HR.Model(&modelshr.ManCont{}).Select("`key`,`name`,`number`,`icon`,`icon_photo`,`wechat`,`work_wechat`,`admin_org`,`position`,`teamid`,`mobilephone`,`company`").Where("`admin_org` IN ? AND `person_in_charge` = ? AND `emp_type` BETWEEN ? AND ?", orgId, 1, 1, 10).Find(&userInfoAry)
if len(userInfoAry) > 0 { if len(userInfoAry) > 0 {
for _, uv := range userInfoAry { for _, uv := range userInfoAry {
UserList = append(UserList, TransformPublicUs(uv)) UserList = append(UserList, TransformPublicUs(uv))

17
api/version1/taskplatform/taskmanagement/runTaskFlow.go

@ -564,12 +564,14 @@ func sunContHandel(sonMapAry []map[string]interface{}, nameKey []customerform.Un
} }
case "timePicker": case "timePicker":
timeVal, _ := publicmethod.StringToInt64(val) timeVal, _ := publicmethod.StringToInt64(val)
taskInfo.Value = publicmethod.UnixTimeToDay(timeVal/1000, 6) taskInfo.Value = publicmethod.UnixTimeToDay(timeVal/1000, 5)
case "expand-user": case "expand-user":
valStr := publicmethod.TypeToInterface(val) // valStr := publicmethod.TypeToInterface(val)
var peopleAry []string // fmt.Printf("用户类型:%T--->%v=====%v\n", val, val, valStr)
json.Unmarshal([]byte(valStr), &peopleAry) // var peopleAry []string
taskInfo.Value = strings.Join(peopleAry, ",") // json.Unmarshal([]byte(valStr), &peopleAry)
// taskInfo.Value = strings.Join(peopleAry, ",")
taskInfo.Value = val
case "orgCentent": case "orgCentent":
var orgCont modelshr.AdministrativeOrganization var orgCont modelshr.AdministrativeOrganization
orgCont.GetCont(map[string]interface{}{"`id`": val}, "`name`") orgCont.GetCont(map[string]interface{}{"`id`": val}, "`name`")
@ -692,7 +694,7 @@ func HistoryValueHand(field string, val interface{}, nameKey []customerform.Unit
taskInfo.Auxiliary = uv.Auxiliary taskInfo.Auxiliary = uv.Auxiliary
taskInfo.Types = uv.Class taskInfo.Types = uv.Class
taskInfo.Sort = uv.Sort taskInfo.Sort = uv.Sort
// fmt.Printf("key: %v, type: %T val:%v\n", field, val, val) fmt.Printf("key: %v, type: %T val:%v Class:%v\n", field, val, val, uv.Class)
switch field { switch field {
case "creater": case "creater":
var createrInfo modelshr.ManCont var createrInfo modelshr.ManCont
@ -839,7 +841,8 @@ func HistoryValueHand(field string, val interface{}, nameKey []customerform.Unit
} }
case "timePicker": case "timePicker":
timeVal, _ := publicmethod.StringToInt64(val) timeVal, _ := publicmethod.StringToInt64(val)
taskInfo.Value = publicmethod.UnixTimeToDay(timeVal/1000, 6) taskInfo.Value = publicmethod.UnixTimeToDay(timeVal/1000, 5)
fmt.Printf("格式---》%v---》%v\n", timeVal, taskInfo.Value)
case "expand-user": case "expand-user":
valStr := publicmethod.TypeToInterface(val) valStr := publicmethod.TypeToInterface(val)
var peopleAry []string var peopleAry []string

18
overall/publicmethod/technique.go

@ -2832,15 +2832,15 @@ func TypeToInterface(val interface{}) string {
} }
} }
if valDataStr, ok := val.(string); ok { // if valDataStr, ok := val.(string); ok {
if valDataStr != "" { // if valDataStr != "" {
return valDataStr // return valDataStr
} else { // } else {
return "" // return ""
} // }
} else { // } else {
return "" // return ""
} // }
} }
/* /*

Loading…
Cancel
Save