Commit 09d7a817 by mushishixian

修复优化

parent aa847dcb
Showing with 4 additions and 1 deletions
...@@ -45,6 +45,10 @@ func GetStandardAttrs(bomItems []model.BomItem) []model.BomItem { ...@@ -45,6 +45,10 @@ func GetStandardAttrs(bomItems []model.BomItem) []model.BomItem {
for _, attr := range encapArray { for _, attr := range encapArray {
encapList = append(encapList, attr.String()) encapList = append(encapList, attr.String())
} }
//如果words大于0,并且识别出来的参数大于等于2,则当作是参数
if len(words) > 0 && len(attrsArray) > 0 {
item.AttrList = attrsList
}
//如果words大于0,并且识别出来的参数为空,则代表是型号 //如果words大于0,并且识别出来的参数为空,则代表是型号
if len(words) > 0 && len(attrsArray) == 0 { if len(words) > 0 && len(attrsArray) == 0 {
item.GoodsName = words[0] item.GoodsName = words[0]
...@@ -57,7 +61,6 @@ func GetStandardAttrs(bomItems []model.BomItem) []model.BomItem { ...@@ -57,7 +61,6 @@ func GetStandardAttrs(bomItems []model.BomItem) []model.BomItem {
if item.Encap == "" && len(encapList) > 0 { if item.Encap == "" && len(encapList) > 0 {
item.Encap = encapList[0] item.Encap = encapList[0]
} }
var attrsSlice []string var attrsSlice []string
for _, attr := range item.AttrList { for _, attr := range item.AttrList {
attrs := GetStandardEsAttr(attr) attrs := GetStandardEsAttr(attr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment