Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
0
Merge Requests
0
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
蒋勇
zhichan
Commits
1e91559b
Commit
1e91559b
authored
Apr 27, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
82a85904
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
20 deletions
+36
-20
iview-admin/src/view/components/tables/forms/childs/uploads.vue
+36
-20
No files found.
iview-admin/src/view/components/tables/forms/childs/uploads.vue
View file @
1e91559b
<
template
>
<div>
<div
class=
"demo-upload-list"
:key=
"
item.name"
v-for=
"item
in ups"
>
<div
class=
"demo-upload-list"
:key=
"
'd'+index"
v-for=
"(item,index)
in ups"
>
<template
v-if=
"item.status === 'finished'"
>
<img
:src=
"item.url"
>
<div
class=
"demo-upload-list-cover"
>
...
...
@@ -96,22 +96,31 @@ export default {
},
handleRemove
(
file
)
{
//to do --添加修改时已经有逻辑,fileList中没有
const
fileList
=
this
.
$refs
.
upload
.
fileList
;
this
.
$refs
.
upload
.
fileList
.
splice
(
fileList
.
indexOf
(
file
),
1
);
const
fileList
=
this
.
uploadList
;
this
.
uploadList
.
splice
(
fileList
.
indexOf
(
file
),
1
);
let
cresults
=
this
.
result
.
split
(
","
)
let
cs
=
cresults
.
filter
(
r
=>
{
return
r
!=
file
.
url
})
this
.
result
=
cs
.
join
(
","
)
this
.
$emit
(
'change'
,
this
.
result
)
},
handleSuccess
(
res
,
file
,
fileList
)
{
// var xml= this.loadXML(res);
// this.result=xml.documentElement.getElementsByTagName("Location")[0].textContent;
//解析filelist,构造逗号分隔的文件列表
console
.
log
(
fileList
);
console
.
log
(
"/////////////////////////////////////////"
,
fileList
);
let
mps
=
fileList
.
map
(
item
=>
{
if
(
item
.
status
==
"finished"
)
{
let
xml
=
this
.
loadXML
(
item
.
response
);
let
tmp
=
xml
.
documentElement
.
getElementsByTagName
(
"Location"
)[
0
]
.
textContent
;
return
tmp
;
if
(
item
.
response
)
{
let
xml
=
this
.
loadXML
(
item
.
response
);
let
tmp
=
xml
.
documentElement
.
getElementsByTagName
(
"Location"
)[
0
]
.
textContent
;
return
tmp
;
}
}
});
mps
.
push
(
this
.
result
);
this
.
result
=
mps
.
join
(
","
);
this
.
$emit
(
"change"
,
this
.
result
);
},
...
...
@@ -137,7 +146,7 @@ export default {
title
:
"Up to five pictures can be uploaded."
});
}
this
.
result
=
""
;
//
this.result = "";
var
myDate
=
new
Date
();
var
key
=
"zc_"
+
...
...
@@ -158,6 +167,7 @@ export default {
created
()
{},
computed
:
{
ups
()
{
let
tmpary
=
[];
let
ti
=
this
.
uploadList
.
map
(
item
=>
{
console
.
log
(
item
);
if
(
item
.
status
==
"finished"
&&
item
.
response
)
{
...
...
@@ -169,15 +179,8 @@ export default {
return
item
;
}
});
// if(this.result){
// let tmpats=[]
// let i=1
// this.result.split(",").forEach(item=>{
// tmpats.push( {name:i++,url:item,status:'finished'})
// })
// return tmpats
// }
return
ti
;
let
t
=
tmpary
.
concat
(
ti
);
return
t
;
}
},
mounted
()
{
...
...
@@ -197,18 +200,31 @@ export default {
console
.
log
(
"cofig fetch failuer"
);
}
});
this
.
$refs
.
upload
.
fileList
=
[];
this
.
uploadList
=
this
.
$refs
.
upload
.
fileList
;
},
watch
:
{
value
:
function
(
v
)
{
this
.
result
=
v
;
if
(
this
.
result
)
{
//打开窗口,给vaue属性赋予值
this
.
$refs
.
upload
.
fileList
=
[];
if
(
this
.
result
&&
this
.
result
!=
""
)
{
console
.
log
(
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>."
);
let
i
=
10
;
this
.
result
.
split
(
","
).
forEach
(
item
=>
{
this
.
uploadList
.
push
({
name
:
i
++
,
url
:
item
,
status
:
"finished"
});
let
sb
=
this
.
uploadList
.
some
(
s
=>
{
if
(
s
.
url
)
{
return
s
.
url
==
item
;
}
});
if
(
!
sb
)
{
this
.
uploadList
.
push
({
name
:
i
++
,
url
:
item
,
status
:
"finished"
});
}
});
}
else
{
this
.
uploadList
=
[]
}
}
}
};
...
...
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