Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
9e6497ec
Commit
9e6497ec
authored
Feb 04, 2023
by
wanglianghe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传进度条
parent
2ad0e860
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
3 deletions
+47
-3
index.vue
src/views/system/version/index.vue
+47
-3
No files found.
src/views/system/version/index.vue
View file @
9e6497ec
...
...
@@ -101,10 +101,22 @@
</el-form-item>
<el-form-item
v-if=
"linkType==2"
>
<el-upload
action=
"#"
:http-request=
"requestUpload"
:show-file-list=
"true"
:before-upload=
"beforeUpload"
>
<el-upload
ref=
"upload"
:limit=
"1"
:headers=
"upload.headers"
:action=
"upload.url"
:data=
"upload.data"
:disabled=
"upload.isUploading"
:show-file-list=
"true"
:on-change=
"handleFileChange"
:on-progress=
"uploadProcess"
:on-success=
"handleFileSuccess"
>
<el-button
size=
"small"
>
{{ $t('上传') }}
<i
class=
"el-icon-upload el-icon--right"
></i>
</el-button>
</el-upload>
</el-form-item>
<el-form-item
:label=
"$t('版本链接')"
prop=
"appUrl"
>
...
...
@@ -132,6 +144,7 @@
import
{
createVersion
,
updateVersion
,
deleteVersion
,
getVersion
,
getVersionPage
,
exportVersionExcel
}
from
"
@/api/system/version
"
;
import
{
getDictDatas
,
DICT_TYPE
}
from
'
@/utils/dict
'
;
import
{
uploadFile
}
from
"
@/api/infra/file
"
;
import
{
getToken
}
from
"
@/utils/auth
"
;
export
default
{
name
:
"
Version
"
,
components
:
{
...
...
@@ -181,7 +194,17 @@ export default {
versionCode
:
[{
required
:
true
,
message
:
this
.
$t
(
"
内部号不能为空
"
),
trigger
:
"
blur
"
}],
appUrl
:
[{
required
:
true
,
message
:
this
.
$t
(
"
版本链接不能为空
"
),
trigger
:
"
blur
"
}],
forceUpdate
:
[{
required
:
true
,
message
:
this
.
$t
(
"
强制更新不能为空
"
),
trigger
:
"
change
"
}],
}
},
// 用户导入参数
upload
:
{
open
:
false
,
// 是否显示弹出层
title
:
""
,
// 弹出层标题
isUploading
:
false
,
// 是否禁用上传
url
:
process
.
env
.
VUE_APP_BASE_API
+
"
/admin-api/infra/file/upload
"
,
// 请求地址
headers
:
{
Authorization
:
"
Bearer
"
+
getToken
()
},
// 设置上传的请求头部
data
:
{}
// 上传的额外数据,用于文件名
},
};
},
...
...
@@ -299,8 +322,29 @@ export default {
}).
catch
(()
=>
{});
},
/** 处理上传的文件发生变化 */
handleFileChange
(
file
,
fileList
)
{
this
.
upload
.
data
.
path
=
this
.
uuid
()
+
"
/
"
+
file
.
name
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
// 清理
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
// 提示成功,并刷新
this
.
$modal
.
msgSuccess
(
"
上传成功
"
);
this
.
$set
(
this
.
form
,
'
appUrl
'
,
response
.
data
);
},
uploadProcess
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
// 禁止修改
},
// 覆盖默认的上传行为
requestUpload
()
{
requestUpload
(
params
)
{
},
// 上传预处理
beforeUpload
(
file
)
{
...
...
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