Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
9355289b
Commit
9355289b
authored
Sep 07, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
05df3500
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
108 deletions
+107
-108
cloze.vue
src/components/questiontype/cloze.vue
+1
-1
koreaUpload.vue
src/pages/koreaUpload.vue
+106
-107
No files found.
src/components/questiontype/cloze.vue
View file @
9355289b
...
...
@@ -258,7 +258,7 @@
}
},
ChangeItem
(
item
,
subItem
)
{
if
(
item
&&
item
.
length
>
0
)
{
if
(
item
&&
item
.
OptionList
.
length
>
0
)
{
item
.
OptionList
.
forEach
(
childItem
=>
{
childItem
.
IsAnswer
=
false
;
})
...
...
src/pages/koreaUpload.vue
View file @
9355289b
<
style
>
.koreaUpload
{
width
:
100%
;
background-color
:
#fff
;
height
:
100%
;
-webkit-text-size-adjust
:
100%
;
-moz-text-size-adjust
:
100%
;
-ms-text-size-adjust
:
100%
;
text-size-adjust
:
100%
;
color
:
#000
;
}
.koreaUpload
{
width
:
100%
;
background-color
:
#fff
;
height
:
100%
;
-webkit-text-size-adjust
:
100%
;
-moz-text-size-adjust
:
100%
;
-ms-text-size-adjust
:
100%
;
text-size-adjust
:
100%
;
color
:
#000
;
}
.koreaUpload
.box
{
width
:
90%
;
height
:
200px
;
margin-top
:
40px
;
border-radius
:
8px
;
margin-left
:
5%
;
border
:
1px
dashed
#e2e2e2
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.koreaUpload
.avatar-uploader
{}
.koreaUpload
.box
{
width
:
90%
;
height
:
200px
;
margin-top
:
40px
;
border-radius
:
8px
;
margin-left
:
5%
;
border
:
1px
dashed
#e2e2e2
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.koreaUpload
.avatar-uploader
{
}
</
style
>
<
template
>
<div
class=
"koreaUpload"
>
<div
class=
"box"
>
<el-upload
class=
"avatar-uploader "
action=
""
:before-upload=
"uploadFile"
:show-file-list=
"false"
>
<i
class=
"el-icon-upload"
style=
"font-size: 40px;color: #e2e2e2;"
></i>
<div
class=
"el-upload__text"
style=
"font-size: 18px;"
>
上传文件
</em></div>
</el-upload>
</div>
<div>
{{
fliename
}}
</div>
<div
class=
"koreaUpload"
>
<div
class=
"box"
>
<el-upload
class=
"avatar-uploader "
action=
""
:before-upload=
"uploadFile"
:show-file-list=
"false"
>
<i
class=
"el-icon-upload"
style=
"font-size: 40px;color: #e2e2e2;"
></i>
<div
class=
"el-upload__text"
style=
"font-size: 18px;"
>
上传文件
</em></div>
</el-upload>
</div>
<div>
{{
fliename
}}
</div>
</div>
</
template
>
<
script
>
import
wx
from
'weixin-js-sdk'
import
{
UploadViittoFile
}
from
"../api/common/common"
;
export
default
{
meta
:
{
title
:
"文件上传"
},
data
()
{
return
{
data
:
''
,
fliename
:
''
,
};
},
created
()
{
if
(
this
.
$route
.
query
)
{
this
.
data
=
JSON
.
parse
(
this
.
$route
.
query
.
data
)
}
},
methods
:
{
uploadFile
(
files
)
{
console
.
log
(
files
)
let
ft
=
files
.
name
.
substring
(
files
.
name
.
lastIndexOf
(
'.'
)
+
1
,
files
.
name
.
length
)
let
stringArr
=
this
.
data
.
FileType
if
(
stringArr
.
indexOf
(
ft
)
==
'-1'
)
{
//判断文件格式
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请上传正确的文件格式!`
,
position
:
'top'
})
return
false
;
}
if
(
this
.
data
.
FileSizeLimit
>
0
)
{
//判断文件大小
const
size
=
files
.
size
/
1024
/
1024
this
.
FileName
=
size
if
(
size
>
this
.
data
.
FileSizeLimit
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"文件大小不能超过"
+
this
.
data
.
FileSizeLimit
+
"MB哦!"
,
position
:
'top'
})
return
false
;
}
}
UploadViittoFile
(
'korea/Test/Upload'
,
files
,
res
=>
{
console
.
log
(
res
)
if
(
res
.
Code
==
1
)
{
res
.
data
=
this
.
data
;
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
wx
.
miniProgram
.
postMessage
({
data
:
res
})
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"上传失败!"
,
position
:
'top'
})
return
false
;
}
}).
catch
(()
=>
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"上传失败!"
,
position
:
'top'
})
return
false
;
})
},
import
wx
from
'weixin-js-sdk'
},
mounted
()
{
}
};
import
{
UploadViittoFile
}
from
"../api/common/common"
;
export
default
{
meta
:
{
title
:
"文件上传"
},
data
()
{
return
{
data
:
''
,
fliename
:
''
,
};
},
created
()
{
if
(
this
.
$route
.
query
)
{
this
.
data
=
JSON
.
parse
(
this
.
$route
.
query
.
data
)
}
},
methods
:
{
uploadFile
(
files
)
{
let
ft
=
files
.
name
.
substring
(
files
.
name
.
lastIndexOf
(
'.'
)
+
1
,
files
.
name
.
length
)
let
stringArr
=
this
.
data
.
FileType
if
(
stringArr
.
indexOf
(
ft
)
==
'-1'
)
{
//判断文件格式
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`请上传正确的文件格式!`
,
position
:
'top'
})
return
false
;
}
if
(
this
.
data
.
FileSizeLimit
>
0
)
{
//判断文件大小
const
size
=
files
.
size
/
1024
/
1024
this
.
FileName
=
size
if
(
size
>
this
.
data
.
FileSizeLimit
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"文件大小不能超过"
+
this
.
data
.
FileSizeLimit
+
"MB哦!"
,
position
:
'top'
})
return
false
;
}
}
UploadViittoFile
(
'korea/Test/Upload'
,
files
,
res
=>
{
if
(
res
.
Code
==
1
)
{
res
.
data
=
this
.
data
;
wx
.
miniProgram
.
navigateBack
({
delta
:
1
})
wx
.
miniProgram
.
postMessage
({
data
:
res
})
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"上传失败!"
,
position
:
'top'
})
return
false
;
}
}).
catch
(()
=>
{
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
"上传失败!"
,
position
:
'top'
})
return
false
;
})
},
},
mounted
()
{}
};
</
script
>
\ No newline at end of file
</
script
>
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