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
71179480
Commit
71179480
authored
Jan 23, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导出
parent
7dfe036d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
1 deletion
+88
-1
indexApi.js
src/api/courseManagement/indexApi.js
+9
-0
index.vue
src/views/courseInformation/courseManagement/index.vue
+79
-1
No files found.
src/api/courseManagement/indexApi.js
View file @
71179480
...
...
@@ -340,3 +340,12 @@ export function updateCourseStatusIds(data) {
data
})
}
// 6. 导出课程表
export
function
exportCourse
(
query
)
{
return
request
({
url
:
'/blesson/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/views/courseInformation/courseManagement/index.vue
View file @
71179480
...
...
@@ -198,6 +198,16 @@
>
{{
commonField
.
addName
}}
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-has-permi=
"hasAddPerm"
:class=
"commonField.addClass"
:type=
"commonField.typePrimary"
:size=
"commonField.smallSize"
@
click=
"handleExport"
>
导出
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-has-permi=
"hasAddPerm"
...
...
@@ -782,7 +792,12 @@ import {
findZIpInfo
,
delZip
,
downloadZip
,
queryPcLessonEvaluationByPagination
,
ossinfoUploadCourse
,
ossinfoUpload
,
updateVideo
,
updateCourseStatusIds
queryPcLessonEvaluationByPagination
,
ossinfoUploadCourse
,
ossinfoUpload
,
updateVideo
,
updateCourseStatusIds
,
exportCourse
}
from
'@/api/courseManagement/indexApi'
import
{
updatePagesRes
,
updateRes
,
updateResponseUrl
}
from
'@/utils/updateUrl'
import
commonField
from
'@/utils/commonField'
...
...
@@ -792,6 +807,7 @@ import { urlDecrypt, urlEncrypt } from '@/utils/jsencrypt'
import
home_pic_kecheng
from
'@/assets/image/home_pic_kecheng.png'
import
{
getDataCache
,
setDataCache
}
from
'@/assets/js/filterData'
import
axios
from
'axios'
import
{
exportCmsBanner
}
from
'@/api/contentManagement/cmsBanner'
export
default
{
name
:
'Index'
,
components
:
{
...
...
@@ -2447,6 +2463,68 @@ export default {
if
(
this
.
filelist
.
length
>
0
)
{
this
.
filelist
=
[]
}
}
,
/** 导出按钮操作 */
handleExport
()
{
// 列表渲染数据
const
_this
=
this
var
newClassPlan
=
''
var
newClassPlanSchool
=
''
if
(
_this
.
queryParams
.
classPlan
.
length
>
0
)
{
newClassPlan
=
_this
.
queryParams
.
classPlan
.
join
(
','
)
}
else
{
newClassPlan
=
_this
.
queryParams
.
classPlan
}
if
(
_this
.
queryParams
.
classPlanSchool
.
length
>
0
)
{
newClassPlanSchool
=
_this
.
queryParams
.
classPlanSchool
.
join
(
','
)
}
else
{
newClassPlanSchool
=
_this
.
queryParams
.
classPlanSchool
}
const
params
=
{
page
:
_this
.
queryParams
.
page
,
rows
:
_this
.
queryParams
.
rows
,
lessonDescription
:
_this
.
queryParams
.
lessonDescription
,
lessonName
:
_this
.
queryParams
.
lessonName
,
classHour
:
_this
.
queryParams
.
classHour
,
classPlan
:
newClassPlan
,
classPlanSchool
:
newClassPlanSchool
,
jobClassify
:
_this
.
queryParams
.
jobClassify
,
tecClassify
:
_this
.
queryParams
.
tecClassify
,
tecClassifySchool
:
_this
.
queryParams
.
tecClassifySchool
,
difficultyClassify
:
_this
.
queryParams
.
difficultyClassify
,
lessonBrief
:
_this
.
queryParams
.
lessonBrief
,
lessonTeaName
:
_this
.
queryParams
.
lessonTeaName
,
lessonPrice
:
_this
.
queryParams
.
lessonPrice
,
homeDisplay
:
_this
.
queryParams
.
homeDisplay
,
flag
:
_this
.
queryParams
.
flag
,
schoolQualityLesson
:
_this
.
queryParams
.
schoolQualityLesson
,
entQualityLesson
:
_this
.
queryParams
.
entQualityLesson
,
qualityLesson
:
_this
.
queryParams
.
qualityLesson
,
lessonType
:
_this
.
queryParams
.
lessonType
.
length
>
1
?
'2'
:
_this
.
queryParams
.
lessonType
.
join
(
','
),
chronologicalOrdering
:
_this
.
queryParams
.
chronologicalOrdering
,
isAppraisal
:
_this
.
queryParams
.
isAppraisal
,
courseType
:
_this
.
queryParams
.
courseType
,
courseTypeC
:
_this
.
queryParams
.
courseTypeC
,
intelligentClassroom
:
_this
.
queryParams
.
intelligentClassroom
,
enterpriseCourseDimensions
:
_this
.
queryParams
.
courseDimensions
}
this
.
$confirm
(
'是否确认操作?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}
).
then
(
function
()
{
return
exportCourse
(
params
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'课程信息'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
}
)
}
)
}
}
}
...
...
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