Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
e8a457dc
提交
e8a457dc
authored
1月 04, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 上传作业文件增加上传中的状态
上级
fade4c17
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
1 行删除
+6
-1
upload.vue
src/modules/viewer/components/common/upload.vue
+6
-1
没有找到文件。
src/modules/viewer/components/common/upload.vue
浏览文件 @
e8a457dc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"upload"
>
<div
class=
"upload"
>
<el-upload
action
:disabled=
"disabled"
:show-file-list=
"false"
:http-request=
"httpRequest"
v-bind=
"$attrs"
>
<el-upload
action
:disabled=
"disabled"
:show-file-list=
"false"
:http-request=
"httpRequest"
v-bind=
"$attrs"
>
<slot></slot>
<slot></slot>
<el-button
type=
"text"
icon=
"el-icon-upload"
>
{{
$t
(
'viewerWork.clickUpload'
)
}}
</el-button>
<el-button
type=
"text"
icon=
"el-icon-upload"
:loading=
"loading"
>
{{
$t
(
'viewerWork.clickUpload'
)
}}
</el-button>
<template
v-slot:tip
>
<template
v-slot:tip
>
<div
class=
"el-upload__tips"
>
<div
class=
"el-upload__tips"
>
<slot
name=
"tip"
></slot>
<slot
name=
"tip"
></slot>
...
@@ -43,6 +43,7 @@ export default {
...
@@ -43,6 +43,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
fileList
:
[]
fileList
:
[]
}
}
},
},
...
@@ -67,6 +68,7 @@ export default {
...
@@ -67,6 +68,7 @@ export default {
},
},
methods
:
{
methods
:
{
httpRequest
(
xhr
)
{
httpRequest
(
xhr
)
{
this
.
loading
=
true
api
api
.
uploadFile
({
file
:
xhr
.
file
})
.
uploadFile
({
file
:
xhr
.
file
})
.
then
(
response
=>
{
.
then
(
response
=>
{
...
@@ -84,6 +86,9 @@ export default {
...
@@ -84,6 +86,9 @@ export default {
.
catch
(
error
=>
{
.
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
message
)
this
.
$message
.
error
(
error
.
message
)
})
})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
},
handleRemove
(
index
)
{
handleRemove
(
index
)
{
this
.
fileList
.
splice
(
index
,
1
)
this
.
fileList
.
splice
(
index
,
1
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论