Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
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
游洁
thinkApp
Commits
b37e7ed0
Commit
b37e7ed0
authored
May 30, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
1c57d044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
34 deletions
+122
-34
examList.vue
src/components/index/workSituation/examList.vue
+122
-34
No files found.
src/components/index/workSituation/examList.vue
View file @
b37e7ed0
<
template
>
<view
class=
"examList-box"
>
<view
class=
"examList-import"
@
click
.
stop
=
"ImportInformation"
>
<view
class=
"examList-import"
@
click=
"ImportInformation"
>
<van-icon
name=
"plus"
/>
<text>
导入考试信息
</text>
</view>
...
...
@@ -30,11 +30,11 @@
</view>
</view>
</view>
<view
class=
"examList-center-hint flex"
>
<view
class=
"examList-center-hint flex"
v-if=
"item.FailNum>0"
>
<view
class=
"examList-hint-left flex"
>
<van-icon
name=
"warning"
/>
<view>
导入失败(学员信息不匹配)可点击查看具体情况
导入失败(
{{
item
.
FailNum
}}
学员信息不匹配)可点击查看具体情况
</view>
</view>
<view
class=
"examList-hint-right"
>
...
...
@@ -44,9 +44,9 @@
</view>
</view>
<van-popup
:show=
"show"
:round=
"true"
>
<van-popup
:show=
"show"
:round=
"true"
@
close=
"closepopup"
>
<view
class=
"examList-popup-box"
>
<van-icon
class=
"examList-popup-closure"
name=
"cross"
@
click=
"
show=false
"
/>
<van-icon
class=
"examList-popup-closure"
name=
"cross"
@
click=
"
closepopup
"
/>
<view
class=
"examList-popup-title"
>
导入考试信息
</view>
<view
class=
"examList-popup-content"
>
<input
v-model=
"uploadParm.ExamName"
class=
"examList-popup-name"
placeholder=
"请输入考试名称"
>
...
...
@@ -55,6 +55,7 @@
multiple
accept=
".excel"
preview-size=
"120rpx"
:before-read=
"beforeRead"
@
after-read=
"customUpload"
>
<view
class=
"examList-popup-fil"
>
...
...
@@ -79,7 +80,7 @@
import
{
uploadFile
}
from
"@/utils/index"
;
export
default
{
props
:
{
dataList
:[]
dataList
:[]
,
},
components
:
{},
setup
(
props
)
{
...
...
@@ -95,8 +96,8 @@
// Uid:726615,
// CourseId:44977497,
Uid
:
0
,
CourseId
:
0
,
ExamName
:
'
考试测试530
'
CourseId
:
44977497
,
ExamName
:
''
},
fileList
:[],
Msg
:{
...
...
@@ -113,30 +114,96 @@
url
:
'/pages/index/examDetails?examId='
+
item
});
},
closepopup
(){
data
.
show
=
false
data
.
uploadParm
=
{
Uid
:
''
,
CourseId
:
''
,
ExamName
:
''
}
},
// 重新导入
clickReimport
(
item
){
data
.
uploadParm
=
{
Uid
:
item
.
ExamId
,
CourseId
:
item
.
CourseId
,
ExamName
:
item
.
ExamName
// data.uploadParm.ExamName = item.ExamName
// data.uploadParm.Uid = data.userData.Id
// data.uploadParm.CourseId = data.Msg.CourseId
// data.uploadParm.ExamName = tem.ExamName
uni
.
showModal
({
title
:
'提示'
,
content
:
'重新导入将要删除该数据,是否继续'
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
that
.
DelExamInfo
(
item
)
}
else
if
(
res
.
cancel
)
{
uni
.
showToast
({
title
:
'已取消删除'
,
icon
:
'none'
,
duration
:
500
})
}
}
});
},
// 删除接口
DelExamInfo
(
item
){
let
Msg
=
{
ExamId
:
item
.
ExamId
}
proxy
.
$request
(
"/Exam/DelExamInfo"
,
Msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
){
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'none'
,
duration
:
500
})
data
.
show
=
true
}
})
},
ImportInformation
(){
data
.
show
=
true
},
uploadFilesBefore
(){
beforeRead
(
file
){
if
(
!
data
.
uploadParm
.
ExamName
){
uni
.
showToast
({
title
:
'请输入考试名称'
,
icon
:
'none'
,
duration
:
500
})
return
}
if
(
file
.
url
.
indexOf
(
'xls'
)
==-
1
||
file
.
url
.
indexOf
(
'xlsx'
)
==-
1
)
{
uni
.
showToast
({
title
:
'请上传 xls/xlsx 格式图片'
,
icon
:
'none'
,
duration
:
500
})
return
false
;
}
return
true
;
},
// 添加导入
customUpload
(
event
){
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
host
=
'http://192.168.10.36:8082/api'
}
else
{
host
=
'https://eduapi.oytour.com/api'
}
data
.
userData
=
uni
.
getStorageSync
(
'userInfo'
)
const
{
file
}
=
event
.
detail
;
that
.
uploadFileFun
(
file
)
// uploadFile(params, file, (res) => {
// uni.showModal({
// title:res.Message
// })
// });
// return
},
uploadFileFun
(
file
){
if
(
!
data
.
uploadParm
.
ExamName
){
uni
.
showToast
({
title
:
'请输入考试名称'
,
icon
:
'none'
,
duration
:
500
})
return
}
if
(
file
[
0
].
url
.
indexOf
(
'xls'
)
==-
1
||
file
[
0
].
url
.
indexOf
(
'xlsx'
)
==-
1
){
uni
.
showToast
({
title
:
'请上传xls、xlsx格式的文件'
,
...
...
@@ -145,7 +212,19 @@
})
return
}
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
host
=
'http://192.168.10.36:8082/api'
}
else
{
host
=
'https://eduapi.oytour.com/api'
}
data
.
userData
=
uni
.
getStorageSync
(
'userInfo'
)
data
.
uploadParm
=
{
Uid
:
data
.
userData
.
Id
,
CourseId
:
data
.
uploadParm
.
CourseId
,
ExamName
:
data
.
uploadParm
.
ExamName
}
console
.
log
(
data
.
uploadParm
,
'-----'
)
uni
.
uploadFile
({
url
:
host
+
'/Upload/UploadStuExamScore'
,
filePath
:
file
[
0
].
url
,
...
...
@@ -155,24 +234,33 @@
params
:
JSON
.
stringify
(
data
.
uploadParm
)
},
success
(
res
)
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
res
.
Code
==
1
?
'导入成功'
:
'导入失败'
,
icon
:
'none'
,
duration
:
500
})
if
(
res
.
Code
==
1
){
uni
.
showToast
({
title
:
'导入成功'
,
icon
:
'none'
,
duration
:
500
})
uni
.
hideLoading
();
data
.
uploadParm
=
{
Uid
:
''
,
CourseId
:
''
,
ExamName
:
''
}
}
else
{
uni
.
showToast
({
title
:
'导入失败'
,
icon
:
'none'
,
duration
:
500
})
uni
.
hideLoading
();
}
this
.
$parent
.
getExamPageList
();
},
fail
(
err
)
{
console
.
log
(
"uploadErr"
,
err
)
}
});
// uploadFile(params, file, (res) => {
// uni.showModal({
// title:res.Message
// })
// });
// return
}
};
let
that
=
methods
;
...
...
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