Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ETL-admin
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
莫晓莉
ETL-admin
Commits
b6ba5a82
Commit
b6ba5a82
authored
Jan 27, 2021
by
莫晓莉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
热热热
parent
6ccf3f6a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
src/views/task/homework.vue
+49
-3
src/views/task/transform.vue
+4
-0
No files found.
src/views/task/homework.vue
View file @
b6ba5a82
...
...
@@ -185,7 +185,7 @@
>
<!-- <div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div> -->
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
可上传任意格式文件,且不超过
1
00M
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
可上传任意格式文件,且不超过
5
00M
</div>
</el-upload>
</el-form-item>
<el-form-item
prop=
"name"
label=
"作业名称:"
>
...
...
@@ -554,7 +554,7 @@ export default {
params
.
type
=
type
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
type
==
2
&&
params
.
path
==
''
){
if
(
type
==
2
&&
params
.
path
==
undefined
){
this
.
$message
.
error
(
"请上传一个文件!"
);
return
;
}
...
...
@@ -723,9 +723,56 @@ export default {
})
},
//----------------------------------------------------------------------------------
// acceptFile(e) {
// const allowHook = {
// video: '.mp4, .ogv, .ogg, .webm',
// audio: '.wav, .mp3, .ogg, .acc, .webm, .amr',
// file: 'doc,.docx,.xlsx,.xls,.pdf',
// excel: 'xlsx,.xls',
// img: '.jpg, .jpeg, .png, .gif'
// }
// if (e) {
// return allowHook[e];
// }
// let srt = null
// for (const k in allowHook) {
// srt += allowHook[k]
// }
// return srt
// },
beforeAvatarUpload
(
file
)
{
console
.
log
(
'上传的文件===:'
,
file
);
// console.log('上传的文件类型===:',file.type);
// const isJPG = file.type === 'image/jpeg';
// const isLt2M = file.size / 1024 / 1024
<
500
;
// if (!isJPG) {
// this.$message.error('上传头像图片只能是 JPG 格式!');
// }
// if (!isLt2M) {
// this.$message.error('上传头像图片大小不能超过 500MB!');
// }
// return isJPG && isLt2M;
var
testmsg
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
)
+
1
)
const
extension
=
testmsg
===
'xls'
const
extension2
=
testmsg
===
'xlsx'
const
isLt2M
=
file
.
size
/
1024
/
1024
<
500
if
(
!
extension
&&
!
extension2
)
{
this
.
$message
.
error
(
'该文件类型不支持!'
);
}
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传文件大小不能超过 500MB!'
);
}
return
extension
||
extension2
&&
isLt2M
},
// 上传资源文件成功
uplodSuccess
(
response
,
file
,
fileList
)
{
console
.
log
(
response
,
file
,
fileList
);
if
(
response
.
success
!==
true
)
{
this
.
$message
.
error
(
"上传失败!"
);
return
;
...
...
@@ -942,7 +989,6 @@ export default {
// if (this.$refs['formNameOne']!==undefined) {
// this.$refs['formNameOne'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
// }
// },
...
...
src/views/task/transform.vue
View file @
b6ba5a82
...
...
@@ -534,6 +534,10 @@ export default {
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// this.formOne.id=1;
if
(
type
==
2
&&
params
.
path
==
undefined
){
this
.
$message
.
error
(
"请上传一个文件!"
);
return
;
}
insert
(
params
).
then
(
res
=>
{
console
.
log
(
'提交新增数据:'
,
res
);
if
(
res
.
success
)
{
...
...
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