Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
66f76808
Commit
66f76808
authored
Oct 16, 2023
by
linhuandong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传控件列表可以修改文件名称
parent
8efa184c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
12 deletions
+32
-12
examples/versions.json
examples/versions.json
+1
-1
package.json
package.json
+1
-1
packages/upload/src/ajax.js
packages/upload/src/ajax.js
+2
-1
packages/upload/src/upload-list.vue
packages/upload/src/upload-list.vue
+21
-5
packages/upload/src/upload.vue
packages/upload/src/upload.vue
+6
-3
src/index.js
src/index.js
+1
-1
No files found.
examples/versions.json
View file @
66f76808
{
"1.4.13"
:
"1.4"
,
"2.0.11"
:
"2.0"
,
"2.1.0"
:
"2.1"
,
"2.2.2"
:
"2.2"
,
"2.3.9"
:
"2.3"
,
"2.4.11"
:
"2.4"
,
"2.5.4"
:
"2.5"
,
"2.6.3"
:
"2.6"
,
"2.7.2"
:
"2.7"
,
"2.8.2"
:
"2.8"
,
"2.9.2"
:
"2.9"
,
"2.10.1"
:
"2.10"
,
"2.11.1"
:
"2.11"
,
"2.12.0"
:
"2.12"
,
"2.13.2"
:
"2.13"
,
"2.14.1"
:
"2.14"
,
"2.15.7675"
:
"2.15"
}
\ No newline at end of file
{
"1.4.13"
:
"1.4"
,
"2.0.11"
:
"2.0"
,
"2.1.0"
:
"2.1"
,
"2.2.2"
:
"2.2"
,
"2.3.9"
:
"2.3"
,
"2.4.11"
:
"2.4"
,
"2.5.4"
:
"2.5"
,
"2.6.3"
:
"2.6"
,
"2.7.2"
:
"2.7"
,
"2.8.2"
:
"2.8"
,
"2.9.2"
:
"2.9"
,
"2.10.1"
:
"2.10"
,
"2.11.1"
:
"2.11"
,
"2.12.0"
:
"2.12"
,
"2.13.2"
:
"2.13"
,
"2.14.1"
:
"2.14"
,
"2.15.7678"
:
"2.15"
}
\ No newline at end of file
package.json
View file @
66f76808
{
"name"
:
"element-ui"
,
"version"
:
"2.15.767
5
"
,
"version"
:
"2.15.767
8
"
,
"description"
:
"A Component Library for Vue.js."
,
"main"
:
"lib/element-ui.common.js"
,
"files"
:
[
...
...
packages/upload/src/ajax.js
View file @
66f76808
...
...
@@ -52,8 +52,9 @@ export default function upload(option) {
formData
.
append
(
key
,
option
.
data
[
key
]);
});
}
formData
.
append
(
'
filename
'
,
option
.
filename
);
formData
.
append
(
option
.
file
name
,
option
.
file
,
option
.
file
.
name
);
formData
.
append
(
option
.
name
,
option
.
file
,
option
.
file
.
name
);
xhr
.
onerror
=
function
error
(
e
)
{
option
.
onError
(
e
);
...
...
packages/upload/src/upload-list.vue
View file @
66f76808
...
...
@@ -13,7 +13,6 @@
:class=
"['el-upload-list__item', 'is-' + file.status, focusing ? 'focusing' : '']"
:key=
"file.uid"
tabindex=
"0"
@
keydown.delete=
"!disabled && $emit('remove', file)"
@
focus=
"focusing = true"
@
blur=
"focusing = false"
@
click=
"focusing = false"
...
...
@@ -24,8 +23,9 @@
v-if=
"file.status !== 'uploading' && ['picture-card', 'picture'].indexOf(listType) > -1"
:src=
"file.url"
alt=
""
>
<a
class=
"el-upload-list__item-name"
@
click=
"handleClick(file)"
>
<i
class=
"el-icon-document"
></i>
{{
file
.
name
}}
<a
@
click=
"handleClick(file)"
>
<i
class=
"el-icon-document"
></i>
<el-input
v-model=
"file.name"
@
focus=
"inputFocus"
@
blur=
"inputBlur"
style=
"display: inline-block;width: 80%;padding:10px 10px 0 0;"
></el-input>
</a>
<label
class=
"el-upload-list__item-status-label"
>
<i
:class=
"
{
...
...
@@ -35,7 +35,7 @@
}">
</i>
</label>
<i
class=
"el-icon-close"
v-if=
"!disabled"
@
click=
"$emit('remove', file)"
></i>
<i
class=
"el-icon-close-tip"
v-if=
"!disabled"
>
{{
t
(
'
el.upload.deleteTip
'
)
}}
</i>
<!--
因为close按钮只在li:focus的时候 display, li blur后就不存在了,所以键盘导航时永远无法 focus到 close按钮上-->
<!--
<i
class=
"el-icon-close-tip"
v-if=
"!disabled"
>
{{
t
(
'
el.upload.deleteTip
'
)
}}
</i>
因为close按钮只在li:focus的时候 display, li blur后就不存在了,所以键盘导航时永远无法 focus到 close按钮上-->
<el-progress
v-if=
"file.status === 'uploading'"
:type=
"listType === 'picture-card' ? 'circle' : 'line'"
...
...
@@ -74,7 +74,9 @@
data
()
{
return
{
focusing
:
false
focusing
:
false
,
tempValue
:
''
,
orgValue
:
''
};
},
components
:
{
ElProgress
},
...
...
@@ -99,6 +101,20 @@
},
handleClick
(
file
)
{
this
.
handlePreview
&&
this
.
handlePreview
(
file
);
},
inputFocus
(
event
)
{
let
val
=
event
.
target
.
value
;
this
.
orgValue
=
val
;
this
.
tempValue
=
val
.
substring
(
val
.
lastIndexOf
(
'
.
'
));
event
.
target
.
value
=
val
.
substring
(
0
,
val
.
lastIndexOf
(
'
.
'
));
},
inputBlur
(
event
)
{
if
(
event
.
target
.
value
===
''
)
{
event
.
target
.
value
=
this
.
orgValue
;
return
;
}
let
val
=
event
.
target
.
value
+
this
.
tempValue
;
event
.
target
.
value
=
val
;
}
}
};
...
...
packages/upload/src/upload.vue
View file @
66f76808
...
...
@@ -85,7 +85,9 @@ export default {
this
.
$refs
.
input
.
value
=
null
;
if
(
!
this
.
beforeUpload
)
{
return
this
.
post
(
rawFile
);
let
file
=
this
.
fileList
.
find
(
o
=>
o
.
uid
===
rawFile
.
uid
);
let
filename
=
file
.
name
+
rawFile
.
name
.
substring
(
rawFile
.
name
.
lastIndexOf
(
'
.
'
));
return
this
.
post
(
rawFile
,
filename
);
}
const
before
=
this
.
beforeUpload
(
rawFile
);
...
...
@@ -132,14 +134,15 @@ export default {
});
}
},
post
(
rawFile
)
{
post
(
rawFile
,
filename
)
{
const
{
uid
}
=
rawFile
;
const
options
=
{
headers
:
this
.
headers
,
withCredentials
:
this
.
withCredentials
,
file
:
rawFile
,
data
:
this
.
data
,
filename
:
this
.
name
,
filename
:
filename
,
name
:
this
.
name
,
action
:
this
.
action
,
onProgress
:
e
=>
{
this
.
onProgress
(
e
,
rawFile
);
...
...
src/index.js
View file @
66f76808
...
...
@@ -210,7 +210,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export
default
{
version
:
'
2.15.767
5
'
,
version
:
'
2.15.767
8
'
,
locale
:
locale
.
use
,
i18n
:
locale
.
i18n
,
install
,
...
...
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