Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
property-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘帅
property-management
Commits
315d9b06
Commit
315d9b06
authored
May 30, 2025
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.优化
parent
5ef59df4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
index.vue
propertyManagement-ui/src/components/ImageUpload/index.vue
+23
-11
No files found.
propertyManagement-ui/src/components/ImageUpload/index.vue
View file @
315d9b06
...
@@ -89,21 +89,33 @@ export default {
...
@@ -89,21 +89,33 @@ export default {
value
:
{
value
:
{
async
handler
(
val
)
{
async
handler
(
val
)
{
if
(
val
)
{
if
(
val
)
{
// 首先将值转为数组
const
list
=
Array
.
isArray
(
val
)
?
val
:
this
.
value
.
split
(
'
,
'
);
let
list
;
if
(
Array
.
isArray
(
val
))
{
list
=
val
;
}
else
{
await
listByIds
(
val
).
then
(
res
=>
{
list
=
res
.
data
;
})
}
// 然后将数组转为对象数组
// 然后将数组转为对象数组
this
.
fileList
=
list
.
map
(
item
=>
{
this
.
fileList
=
list
.
map
(
item
=>
{
// 此处name使用ossId 防止删除出现重名
if
(
typeof
item
===
"
string
"
)
{
item
=
{
name
:
item
.
ossId
,
url
:
item
.
url
,
ossId
:
item
.
ossId
};
if
(
item
.
indexOf
(
this
.
baseUrl
)
===
-
1
)
{
item
=
{
name
:
item
,
url
:
item
};
}
else
{
item
=
{
name
:
item
,
url
:
item
};
}
}
return
item
;
return
item
;
});
});
// 首先将值转为数组
// let list;
// if (Array.isArray(val)) {
// list = val;
// } else {
// await listByIds(val).then(res => {
// list = res.data;
// })
// }
// // 然后将数组转为对象数组
// this.fileList = list.map(item => {
// // 此处name使用ossId 防止删除出现重名
// item = { name: item.ossId, url: item.url, ossId: item.ossId };
// return item;
// });
}
else
{
}
else
{
this
.
fileList
=
[];
this
.
fileList
=
[];
return
[];
return
[];
...
...
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