feat(课程模块): 添加购课明细功能及相关路由
- 在课程模块中新增购课明细页面,支持查看课程购买详情 - 更新路由配置,添加购课明细的路由路径 - 在课程列表中添加“查看购课明细”按钮,优化用户操作体验 - 更新状态管理,支持动态更新主标签的查询和参数信息
This commit is contained in:
@@ -210,7 +210,7 @@
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="280"
|
||||
width="360"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
@@ -280,6 +280,13 @@
|
||||
<!-- </el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="showCoursePurchaseDetails(scope.row)"
|
||||
>查看购课明细</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -872,6 +879,31 @@ export default {
|
||||
this.$forceUpdate();
|
||||
// row ? (this.courseId = row.id) : "";
|
||||
},
|
||||
showCoursePurchaseDetails(row) {
|
||||
const list = (row && row.courseCatalogueEntityList) || [];
|
||||
const catalogue = Array.isArray(list)
|
||||
? list.map(item => ({
|
||||
id: item.id,
|
||||
title: item.title
|
||||
}))
|
||||
: [];
|
||||
if (!catalogue.length) {
|
||||
this.$message.warning("该课程未设置目录,无法查看购买明细。");
|
||||
return;
|
||||
}
|
||||
const firstCatalogueId =
|
||||
catalogue && catalogue.length > 0 ? String(catalogue[0].id) : "";
|
||||
|
||||
this.$router.push({
|
||||
name: "course-coursePurchaseDetails",
|
||||
query: {
|
||||
courseId: row.id,
|
||||
courseName: row.title || "",
|
||||
catalogueId: firstCatalogueId,
|
||||
catalogue: encodeURIComponent(JSON.stringify(catalogue || []))
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
|
||||
Reference in New Issue
Block a user