Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
09d7a817
authored
Mar 12, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复优化
parent
aa847dcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
internal/logic/attr.go
internal/logic/attr.go
View file @
09d7a817
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment