Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea-resources-web
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
张伯涛
tea-resources-web
Commits
325c665c
Commit
325c665c
authored
Apr 19, 2024
by
FangYuePeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试题导入
parent
a714e453
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
10 deletions
+37
-10
teaExamQuestions.js
src/api/examination/teaExamQuestions.js
+26
-0
index.vue
src/views/courseInformation/courseManagement/index.vue
+1
-1
examinationPaper.vue
...rseInformation/examinationManagement/examinationPaper.vue
+10
-9
No files found.
src/api/examination/teaExamQuestions.js
View file @
325c665c
...
@@ -78,3 +78,29 @@ export function updateStatus(data) {
...
@@ -78,3 +78,29 @@ export function updateStatus(data) {
data
data
})
})
}
}
// 8.下载开课导入模板
export
function
importTemplateTrialCourse
(
params
)
{
return
request
({
url
:
'/teaexamquestions/importTemplate'
,
method
:
'get'
,
responseType
:
'blob'
,
params
})
}
// 9.导入开课信息
export
function
importExcel
(
data
,
courseId
)
{
return
request
({
url
:
'/teaexamquestions/importDictData'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
transformRequest
:
[(
data
)
=>
{
return
data
}],
data
,
params
:
{
courseId
}
})
}
src/views/courseInformation/courseManagement/index.vue
View file @
325c665c
...
@@ -1222,7 +1222,7 @@ export default {
...
@@ -1222,7 +1222,7 @@ export default {
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'/courseInformation/examinationManagement/index'
,
path
:
'/courseInformation/examinationManagement/index'
,
query
:
{
query
:
{
bussinessId
:
data
.
bus
s
inessId
,
bussinessId
:
data
.
businessId
,
courseId
:
data
.
businessId
,
courseId
:
data
.
businessId
,
name
:
data
.
lessonName
,
name
:
data
.
lessonName
,
passingGrade
:
data
.
passingGrade
passingGrade
:
data
.
passingGrade
...
...
src/views/courseInformation/examinationManagement/examinationPaper.vue
View file @
325c665c
...
@@ -295,8 +295,6 @@
...
@@ -295,8 +295,6 @@
</div>
</div>
</el-dialog>
</el-dialog>
<!-- 导入对话框 -->
<!-- 导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"500px"
append-to-body
>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"500px"
append-to-body
>
<el-upload
<el-upload
...
@@ -331,7 +329,6 @@
...
@@ -331,7 +329,6 @@
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -341,10 +338,10 @@ import { parseTime } from '@/utils'
...
@@ -341,10 +338,10 @@ import { parseTime } from '@/utils'
import
{
import
{
addTeaExamQuestions
,
addTeaExamQuestions
,
delTeaExamQuestions
,
getTeaExamQuestions
,
delTeaExamQuestions
,
getTeaExamQuestions
,
listTeaExamQuestions
,
updateStatus
,
updateTeaExamQuestions
listTeaExamQuestions
,
updateStatus
,
updateTeaExamQuestions
,
importExcel
,
importTemplateTrialCourse
}
from
'@/api/examination/teaExamQuestions'
}
from
'@/api/examination/teaExamQuestions'
import
{
importExcel
,
importTemplateTrialCourse
}
from
"@/api/try/teaTrialCourse"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
getToken
}
from
'@/utils/auth'
export
default
{
export
default
{
name
:
'ExaminationPaper'
,
name
:
'ExaminationPaper'
,
props
:
{
props
:
{
...
@@ -484,6 +481,8 @@ export default {
...
@@ -484,6 +481,8 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
courseId
=
this
.
$route
.
query
.
courseId
console
.
log
(
this
.
courseId
)
},
},
mounted
:
function
()
{
mounted
:
function
()
{
this
.
loadData
()
this
.
loadData
()
...
@@ -822,7 +821,7 @@ export default {
...
@@ -822,7 +821,7 @@ export default {
number
:
''
,
number
:
''
,
questionType
:
1
,
questionType
:
1
,
questionStem
:
''
,
questionStem
:
''
,
courseId
:
this
.
bussinessId
===
''
?
''
:
this
.
bussiness
Id
,
courseId
:
this
.
courseId
===
''
?
''
:
this
.
course
Id
,
difficulty
:
1
,
difficulty
:
1
,
content
:
''
,
content
:
''
,
answer
:
''
,
answer
:
''
,
...
@@ -882,6 +881,7 @@ export default {
...
@@ -882,6 +881,7 @@ export default {
},
},
// 提交上传文件
// 提交上传文件
submitFileForm
()
{
submitFileForm
()
{
var
courseId
=
this
.
courseId
// this.$refs.upload.submit()
// this.$refs.upload.submit()
this
.
importLoading
=
true
this
.
importLoading
=
true
if
(
this
.
fileList
.
length
===
0
)
{
if
(
this
.
fileList
.
length
===
0
)
{
...
@@ -892,14 +892,15 @@ export default {
...
@@ -892,14 +892,15 @@ export default {
}
else
{
// 根据后台需求数据格式
}
else
{
// 根据后台需求数据格式
var
formData
=
new
FormData
()
// 当前为空
var
formData
=
new
FormData
()
// 当前为空
formData
.
append
(
'file'
,
this
.
fileList
)
formData
.
append
(
'file'
,
this
.
fileList
)
importExcel
(
formData
).
then
(
res
=>
{
importExcel
(
formData
,
courseId
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
res
.
data
)
this
.
$message
.
success
(
res
.
data
)
this
.
fileList
=
[]
this
.
fileList
=
[]
// 导入成功后关闭弹出框
// 导入成功后关闭弹出框
this
.
upload
.
open
=
false
this
.
upload
.
open
=
false
// 导入成功后刷新页面
// 导入成功后刷新页面
this
.
getList
()
this
.
loadData
()
}
}
this
.
importLoading
=
false
this
.
importLoading
=
false
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
...
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