Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
43e687bf
Commit
43e687bf
authored
Sep 14, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传样式
parent
ed625020
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
files.vue
components/page/files.vue
+25
-25
No files found.
components/page/files.vue
View file @
43e687bf
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<a
:href=
"fileUrlPath"
@
click=
"downFile(item.filePath)"
target=
"_blank"
>
{{
item
.
fileName
}}
</a>
<a
:href=
"fileUrlPath"
@
click=
"downFile(item.filePath)"
target=
"_blank"
>
{{
item
.
fileName
}}
</a>
</Tag>
</Tag>
</div>
</div>
<div
class=
"upload-body"
v-else
>
<div
class=
"upload-body"
v-else
v-show=
"nameList.length>0"
>
<div
<div
class=
"demo-upload-list"
class=
"demo-upload-list"
v-for=
"(item,index) in nameList"
v-for=
"(item,index) in nameList"
...
@@ -66,7 +66,7 @@ import util from "@/libs/util";
...
@@ -66,7 +66,7 @@ import util from "@/libs/util";
export
default
{
export
default
{
name
:
"files"
,
name
:
"files"
,
model
:
{
model
:
{
prop
:
"value"
prop
:
"value"
,
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -83,7 +83,7 @@ export default {
...
@@ -83,7 +83,7 @@ export default {
vshowPro
:
false
,
vshowPro
:
false
,
Photo
:
true
,
Photo
:
true
,
isactive
:
0
,
isactive
:
0
,
imgId
:
null
imgId
:
null
,
};
};
},
},
created
()
{},
created
()
{},
...
@@ -91,41 +91,41 @@ export default {
...
@@ -91,41 +91,41 @@ export default {
value
:
[
String
,
Number
,
Array
,
Object
],
value
:
[
String
,
Number
,
Array
,
Object
],
files
:
{
files
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
singleFile
:
{
singleFile
:
{
//上传单文件
//上传单文件
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
maxSize
:
{
maxSize
:
{
type
:
Number
,
type
:
Number
,
default
:
10240
default
:
10240
,
},
},
parms
:
{
parms
:
{
type
:
[
String
,
Object
],
type
:
[
String
,
Object
],
default
:
""
default
:
""
,
},
},
unClosable
:
{
unClosable
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
cloudIco
:
{
cloudIco
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
fileFormat
:
{
fileFormat
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
Photos
:
{
Photos
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
},
showList
:
{
showList
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
,
}
}
,
},
},
methods
:
{
methods
:
{
listData
(
li
,
index
)
{
listData
(
li
,
index
)
{
...
@@ -192,9 +192,9 @@ export default {
...
@@ -192,9 +192,9 @@ export default {
removeFile
(
file
,
fileList
)
{},
removeFile
(
file
,
fileList
)
{},
handleClose2
(
event
,
name
)
{
handleClose2
(
event
,
name
)
{
//删除上传到文件服务器上的文件
//删除上传到文件服务器上的文件
this
.
$http
.
sysUser
.
deleteFile
(
name
).
then
(
res
=>
{
this
.
$http
.
sysUser
.
deleteFile
(
name
).
then
(
(
res
)
=>
{
if
(
res
.
status
==
0
)
{
if
(
res
.
status
==
0
)
{
const
index
=
this
.
nameList
.
findIndex
(
function
(
item
)
{
const
index
=
this
.
nameList
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
name
;
return
item
.
id
===
name
;
});
});
this
.
nameList
.
splice
(
index
,
1
);
this
.
nameList
.
splice
(
index
,
1
);
...
@@ -225,7 +225,7 @@ export default {
...
@@ -225,7 +225,7 @@ export default {
"doc"
,
"doc"
,
"xls"
,
"xls"
,
"xlsx"
,
"xlsx"
,
"txt"
"txt"
,
];
];
}
}
return
this
.
formatList
;
return
this
.
formatList
;
...
@@ -253,10 +253,10 @@ export default {
...
@@ -253,10 +253,10 @@ export default {
}
}
this
.
nameList
=
[];
this
.
nameList
=
[];
//查询上传到文件服务器上的文件
//查询上传到文件服务器上的文件
this
.
$http
.
sysUser
.
getFile
(
this
.
parms
).
then
(
res
=>
{
this
.
$http
.
sysUser
.
getFile
(
this
.
parms
).
then
(
(
res
)
=>
{
if
(
res
.
data
!=
[]
&&
res
.
data
.
length
>
0
)
{
if
(
res
.
data
!=
[]
&&
res
.
data
.
length
>
0
)
{
var
items
=
[];
var
items
=
[];
res
.
data
.
forEach
(
data
=>
{
res
.
data
.
forEach
(
(
data
)
=>
{
let
objImag
=
{};
let
objImag
=
{};
objImag
.
fileName
=
data
.
fileName
;
objImag
.
fileName
=
data
.
fileName
;
objImag
.
filePath
=
data
.
downloadPath
;
objImag
.
filePath
=
data
.
downloadPath
;
...
@@ -283,9 +283,9 @@ export default {
...
@@ -283,9 +283,9 @@ export default {
}
}
this
.
nameList
=
[];
this
.
nameList
=
[];
//查询上传到文件服务器上的文件
//查询上传到文件服务器上的文件
this
.
$http
.
sysUser
.
getFile
(
this
.
parms
).
then
(
res
=>
{
this
.
$http
.
sysUser
.
getFile
(
this
.
parms
).
then
(
(
res
)
=>
{
if
(
res
.
data
!=
[]
&&
res
.
data
.
length
>
0
)
{
if
(
res
.
data
!=
[]
&&
res
.
data
.
length
>
0
)
{
res
.
data
.
forEach
(
data
=>
{
res
.
data
.
forEach
(
(
data
)
=>
{
let
objImag
=
{};
let
objImag
=
{};
objImag
.
fileName
=
data
.
fileName
;
objImag
.
fileName
=
data
.
fileName
;
objImag
.
filePath
=
data
.
downloadPath
;
objImag
.
filePath
=
data
.
downloadPath
;
...
@@ -311,7 +311,7 @@ export default {
...
@@ -311,7 +311,7 @@ export default {
for
(
var
key
in
data
)
{
for
(
var
key
in
data
)
{
var
value
=
data
[
key
];
var
value
=
data
[
key
];
if
(
value
.
constructor
==
Array
)
{
if
(
value
.
constructor
==
Array
)
{
value
.
forEach
(
function
(
_value
)
{
value
.
forEach
(
function
(
_value
)
{
_result
.
push
(
key
+
"="
+
_value
);
_result
.
push
(
key
+
"="
+
_value
);
});
});
}
else
{
}
else
{
...
@@ -320,7 +320,7 @@ export default {
...
@@ -320,7 +320,7 @@ export default {
}
}
return
_result
.
join
(
"&"
);
return
_result
.
join
(
"&"
);
}
else
return
""
;
}
else
return
""
;
}
}
,
},
},
computed
:
{},
computed
:
{},
watch
:
{
watch
:
{
...
@@ -332,7 +332,7 @@ export default {
...
@@ -332,7 +332,7 @@ export default {
if
(
v
)
{
if
(
v
)
{
this
.
intFiles
();
this
.
intFiles
();
}
}
}
}
,
},
},
mounted
()
{
mounted
()
{
this
.
formatL
();
this
.
formatL
();
...
@@ -345,7 +345,7 @@ export default {
...
@@ -345,7 +345,7 @@ export default {
}
else
{
}
else
{
this
.
Photo
=
true
;
this
.
Photo
=
true
;
}
}
}
}
,
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
@@ -353,7 +353,7 @@ export default {
...
@@ -353,7 +353,7 @@ export default {
width: 100%;
width: 100%;
border: 1px solid #eee;
border: 1px solid #eee;
margin-top: 10px;
margin-top: 10px;
padding-top:5px;
padding-top:
5px;
.demo-upload-list {
.demo-upload-list {
display: inline-block;
display: inline-block;
width: 60px;
width: 60px;
...
...
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