Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
1441cd31
Commit
1441cd31
authored
Jun 25, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: handle imageAry as plain
parent
3e0881e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
src/views/order/factoryOrderNew/component/CardLayout.vue
+38
-4
No files found.
src/views/order/factoryOrderNew/component/CardLayout.vue
View file @
1441cd31
...
@@ -62,17 +62,17 @@
...
@@ -62,17 +62,17 @@
<
template
#
images
>
<
template
#
images
>
<div
class=
"flex-between"
>
<div
class=
"flex-between"
>
<div
class=
"images-position"
>
<div
class=
"images-position"
>
<div
v-if=
"
item.imageAry
"
class=
"images-container"
>
<div
v-if=
"
parseImageAry(item.imageAry).length
"
class=
"images-container"
>
<div
<div
v-for=
"(img, index) in
JSON.parse(item.imageAry as string
)"
v-for=
"(img, index) in
parseImageAry(item.imageAry
)"
:key=
"index"
:key=
"index"
:title=
"img.title"
:title=
"img.title"
class=
"item-image"
class=
"item-image"
>
>
<el-image
<el-image
:src=
"img
?
.url"
:src=
"img.url"
height=
"50"
height=
"50"
:preview-src-list=
"
JSON.parse(item.imageAry as string).map((i: any
) => i.url)"
:preview-src-list=
"
parseImageAry(item.imageAry).map((i
) => i.url)"
:initial-index=
"index"
:initial-index=
"index"
/>
/>
</div>
</div>
...
@@ -480,6 +480,40 @@ const getPlatformImg = (code: string) => {
...
@@ -480,6 +480,40 @@ const getPlatformImg = (code: string) => {
return
''
return
''
}
}
const
parseImageAry
=
(
imageAry
?:
unknown
,
):
{
url
:
string
;
title
?:
string
}[]
=>
{
if
(
typeof
imageAry
!==
'string'
||
!
imageAry
.
trim
())
return
[]
const
trimmed
=
imageAry
.
trim
()
if
(
trimmed
.
startsWith
(
'http'
))
{
return
trimmed
.
split
(
','
)
.
map
((
url
)
=>
({
url
:
url
.
trim
()
}))
.
filter
((
item
)
=>
item
.
url
)
}
try
{
const
parsed
=
JSON
.
parse
(
trimmed
)
as
unknown
if
(
!
Array
.
isArray
(
parsed
))
return
[{
url
:
trimmed
}]
const
result
:
{
url
:
string
;
title
?:
string
}[]
=
[]
for
(
const
item
of
parsed
)
{
if
(
typeof
item
===
'string'
&&
item
)
{
result
.
push
({
url
:
item
})
}
else
if
(
item
&&
typeof
item
===
'object'
&&
'url'
in
item
)
{
const
url
=
(
item
as
{
url
?:
string
}).
url
if
(
url
)
{
result
.
push
({
url
,
title
:
(
item
as
{
title
?:
string
}).
title
,
})
}
}
}
return
result
}
catch
{
return
[{
url
:
trimmed
}]
}
}
const
getOrderDelayText
=
(
createTime
?:
string
|
null
)
=>
{
const
getOrderDelayText
=
(
createTime
?:
string
|
null
)
=>
{
if
(
!
createTime
)
return
'--'
if
(
!
createTime
)
return
'--'
const
createAt
=
dayjs
(
createTime
)
const
createAt
=
dayjs
(
createTime
)
...
...
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