Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
299fec7b
authored
Aug 23, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】上传组件 TODO fix
parent
f996d00e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
src/components/UploadFile/src/UploadFile.vue
+21
-4
No files found.
src/components/UploadFile/src/UploadFile.vue
View file @
299fec7b
<
template
>
<
template
>
<div
class=
"upload-file"
>
<div
v-if=
"!disabled"
class=
"upload-file"
>
<el-upload
<el-upload
ref=
"uploadRef"
ref=
"uploadRef"
v-model:file-list=
"fileList"
v-model:file-list=
"fileList"
...
@@ -20,11 +20,11 @@
...
@@ -20,11 +20,11 @@
class=
"upload-file-uploader"
class=
"upload-file-uploader"
name=
"file"
name=
"file"
>
>
<el-button
v-if=
"!disabled"
type=
"primary"
>
<el-button
type=
"primary"
>
<Icon
icon=
"ep:upload-filled"
/>
<Icon
icon=
"ep:upload-filled"
/>
选取文件
选取文件
</el-button>
</el-button>
<template
v-if=
"isShowTip
&& !disabled
"
#
tip
>
<template
v-if=
"isShowTip"
#
tip
>
<div
style=
"font-size: 8px"
>
<div
style=
"font-size: 8px"
>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
大小不超过
<b
style=
"color: #f56c6c"
>
{{
fileSize
}}
MB
</b>
</div>
</div>
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
'/'
)
}}
</b>
的文件
格式为
<b
style=
"color: #f56c6c"
>
{{
fileType
.
join
(
'/'
)
}}
</b>
的文件
</div>
</div>
</
template
>
</
template
>
<!-- TODO @puhui999:1)表单展示的时候,位置会偏掉,已发微信
;2)disable 的时候,应该把【删除】按钮也隐藏掉?
-->
<!-- TODO @puhui999:1)表单展示的时候,位置会偏掉,已发微信-->
<
template
#
file=
"row"
>
<
template
#
file=
"row"
>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<span>
{{
row
.
file
.
name
}}
</span>
<span>
{{
row
.
file
.
name
}}
</span>
...
@@ -54,6 +54,18 @@
...
@@ -54,6 +54,18 @@
</
template
>
</
template
>
</el-upload>
</el-upload>
</div>
</div>
<!-- 上传操作禁用时 -->
<div
v-if=
"disabled"
class=
"upload-file"
>
<div
v-for=
"(file, index) in fileList"
:key=
"index"
class=
"flex items-center file-list-item"
>
<span>
{{ file.name }}
</span>
<div
class=
"ml-10px"
>
<el-link
:href=
"file.url"
:underline=
"false"
download
target=
"_blank"
type=
"primary"
>
下载
</el-link>
</div>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
...
@@ -211,4 +223,9 @@ const emitUpdateModelValue = () => {
...
@@ -211,4 +223,9 @@ const emitUpdateModelValue = () => {
:deep
(
.ele-upload-list__item-content-action
.el-link
)
{
:deep
(
.ele-upload-list__item-content-action
.el-link
)
{
margin-right
:
10px
;
margin-right
:
10px
;
}
}
.file-list-item
{
border
:
1px
dashed
var
(
--el-border-color-darker
);
border-radius
:
8px
;
}
</
style
>
</
style
>
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