mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-08 02:16:45 +08:00
调试
This commit is contained in:
@@ -17,27 +17,27 @@ export const changeTagPublic = (row = {}) => http.post(`/admin/courseTag/changeP
|
|||||||
});
|
});
|
||||||
|
|
||||||
//改变标签的热点属性
|
//改变标签的热点属性
|
||||||
const changeTagHot = (row = {}) => http.post(`/admin/courseTag/changeHotStatus`, {
|
export const changeTagHot = (row = {}) => http.post(`/admin/courseTag/changeHotStatus`, {
|
||||||
id: row.id
|
id: row.id
|
||||||
// isPublic: row.isHot
|
// isPublic: row.isHot
|
||||||
});
|
});
|
||||||
|
|
||||||
//查询指定id的标签关联的所有课程
|
//查询指定id的标签关联的所有课程
|
||||||
const showCourseByTag = (query = {}) => http.post(`/admin/courseTag/showCourseByTag`, query);
|
export const showCourseByTag = (query = {}) => http.post(`/admin/courseTag/showCourseByTag`, query);
|
||||||
|
|
||||||
|
|
||||||
//解除指定id的课程和某个标签之间的关联关系
|
//解除指定id的课程和某个标签之间的关联关系
|
||||||
const unbindCourseTagRelation = (params = {}) => http.post(`/admin/courseTag/unbind`, params);
|
export const unbindCourseTagRelation = (params = {}) => http.post(`/admin/courseTag/unbind`, params);
|
||||||
|
|
||||||
//编辑课程:标签模糊查询
|
//编辑课程:标签模糊查询
|
||||||
const searchTags = (params = {}) => http.post(`/admin/courseTag/searchTags`, params);
|
export const searchTags = (params = {}) => http.post(`/admin/courseTag/searchTags`, params);
|
||||||
|
|
||||||
|
|
||||||
//编辑课程:创建标签(与当前课程关联)
|
//编辑课程:创建标签(与当前课程关联)
|
||||||
const createTag = (params = {}) => http.post(`/admin/courseTag/createTag`, params);
|
export const createTag = (params = {}) => http.post(`/admin/courseTag/createTag`, params);
|
||||||
|
|
||||||
//获取最新前10个热点标签
|
//获取最新前10个热点标签
|
||||||
const getHotTagList = (params = {}) => http.post(`/admin/courseTag/getHotTagList`, params);
|
export const getHotTagList = (params = {}) => http.post(`/admin/courseTag/getHotTagList`, params);
|
||||||
|
|
||||||
// export default {
|
// export default {
|
||||||
// portalPageList,
|
// portalPageList,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
<template v-if="column.key === 'useCount'">
|
<template v-if="column.key === 'useCount'">
|
||||||
<a
|
<a
|
||||||
v-if="record.useCount > 0"
|
v-if="record.useCount > 0"
|
||||||
@click="showCourseByTag(record.id)"
|
@click="showCourseByTagg(record.id)"
|
||||||
style="color: #4ea6ff; text-decoration: underline; cursor: pointer;"
|
style="color: #4ea6ff; text-decoration: underline; cursor: pointer;"
|
||||||
>
|
>
|
||||||
{{ record.useCount }}
|
{{ record.useCount }}
|
||||||
@@ -192,8 +192,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import { reactive, toRefs, ref } from "vue";
|
import { reactive, toRefs, ref } from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { apiCourseTag } from "@/api/courseTag.js";
|
// import { apiCourseTag } from "@/api/courseTag.js";
|
||||||
import { portalPageList } from "../../api/courseTag.js";
|
import { portalPageList ,changeTagPublic,changeTagHot,showCourseByTag,unbindCourseTagRelation,searchTags,createTag } from "../../api/courseTag.js";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -377,8 +377,8 @@ export default {
|
|||||||
console.log("获取标签列表 结果 : ",res);
|
console.log("获取标签列表 结果 : ",res);
|
||||||
console.log("获取标签列表 结果 : ",res.status);
|
console.log("获取标签列表 结果 : ",res.status);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
state.tableData = res.data.data.records?.list || [];
|
state.tableData = res.data.data.records || [];
|
||||||
state.tableDataTotal = res.data.data.records?.total || 0;
|
state.tableDataTotal = res.data.data.total || 0;
|
||||||
}else {
|
}else {
|
||||||
message.error('获取数据失败1');
|
message.error('获取数据失败1');
|
||||||
}
|
}
|
||||||
@@ -427,8 +427,15 @@ export default {
|
|||||||
const handlePublicChange = async (record) => {
|
const handlePublicChange = async (record) => {
|
||||||
const originalStatus = record.isPublic;
|
const originalStatus = record.isPublic;
|
||||||
try {
|
try {
|
||||||
await apiCourseTag.changeTagPublic(record);
|
// await apiCourseTag.changeTagPublic(record);
|
||||||
message.success('更新成功');
|
changeTagPublic(record).then ((res) => {
|
||||||
|
console.log("更新公共显示 结果 : ",res);
|
||||||
|
if (res.status === 200) {
|
||||||
|
message.success('更新成功');
|
||||||
|
}else {
|
||||||
|
message.success('更新失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
record.isPublic = originalStatus;
|
record.isPublic = originalStatus;
|
||||||
message.error('更新失败');
|
message.error('更新失败');
|
||||||
@@ -439,13 +446,23 @@ export default {
|
|||||||
const handleHotChange = async (record) => {
|
const handleHotChange = async (record) => {
|
||||||
const originalStatus = record.isHot;
|
const originalStatus = record.isHot;
|
||||||
try {
|
try {
|
||||||
const res = await apiCourseTag.changeTagHot(record);
|
/*const res = await apiCourseTag.changeTagHot(record);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success(res.message);
|
message.success(res.message);
|
||||||
} else {
|
} else {
|
||||||
record.isHot = false;
|
record.isHot = false;
|
||||||
message.warning(res.message);
|
message.warning(res.message);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
changeTagHot(record).then ((res) => {
|
||||||
|
console.log("获取标签列表 结果 : ",res);
|
||||||
|
if (res.status === 200) {
|
||||||
|
message.success(res.message);
|
||||||
|
}else {
|
||||||
|
record.isHot = false;
|
||||||
|
message.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
record.isHot = originalStatus;
|
record.isHot = originalStatus;
|
||||||
message.error('更新失败');
|
message.error('更新失败');
|
||||||
@@ -453,7 +470,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 显示关联课程
|
// 显示关联课程
|
||||||
const showCourseByTag = async (tagId) => {
|
const showCourseByTagg = async (tagId) => {
|
||||||
state.courseDialogVisible = true;
|
state.courseDialogVisible = true;
|
||||||
state.courseSearchParam.id = tagId;
|
state.courseSearchParam.id = tagId;
|
||||||
state.courseSearchParam.pageNo = 1;
|
state.courseSearchParam.pageNo = 1;
|
||||||
@@ -470,7 +487,7 @@ export default {
|
|||||||
id: state.courseSearchParam.id
|
id: state.courseSearchParam.id
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await apiCourseTag.showCourseByTag(params);
|
/*const res = await apiCourseTag.showCourseByTag(params);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
state.courseTableData = res.result?.list || [];
|
state.courseTableData = res.result?.list || [];
|
||||||
state.courseTableTotal = res.result?.count || 0;
|
state.courseTableTotal = res.result?.count || 0;
|
||||||
@@ -479,9 +496,22 @@ export default {
|
|||||||
state.courseDialogVisible = false;
|
state.courseDialogVisible = false;
|
||||||
getTagList();
|
getTagList();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
showCourseByTag(params).then ((res) => {
|
||||||
|
console.log("showCourseByTag 结果 : ",res);
|
||||||
|
if (res.status === 200) {
|
||||||
|
state.courseTableData = res.result?.list || [];
|
||||||
|
state.courseTableTotal = res.result?.count || 0;
|
||||||
|
if (state.courseTableTotal === 0) {
|
||||||
|
state.courseDialogVisible = false;
|
||||||
|
getTagList();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
message.error(' showCourseByTag 获取数据失败1');
|
||||||
|
}
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('获取数据失败');
|
message.error('showCourseByTag 获取数据失败');
|
||||||
} finally {
|
} finally {
|
||||||
state.courseTableLoading = false;
|
state.courseTableLoading = false;
|
||||||
}
|
}
|
||||||
@@ -507,12 +537,22 @@ export default {
|
|||||||
courseId: record.courseId
|
courseId: record.courseId
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await apiCourseTag.unbindCourseTagRelation(params);
|
/*const res = await apiCourseTag.unbindCourseTagRelation(params);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('解绑成功');
|
message.success('解绑成功');
|
||||||
getCourseListByTag();
|
getCourseListByTag();
|
||||||
getTagList(); // 刷新主列表
|
getTagList(); // 刷新主列表
|
||||||
}
|
}*/
|
||||||
|
unbindCourseTagRelation(params).then ((res) => {
|
||||||
|
console.log("解绑 结果 : ",res);
|
||||||
|
if (res.status === 200) {
|
||||||
|
message.success('解绑成功');
|
||||||
|
getCourseListByTag();
|
||||||
|
getTagList(); // 刷新主列表
|
||||||
|
}else {
|
||||||
|
message.error('解绑失败1');
|
||||||
|
}
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('解绑失败');
|
message.error('解绑失败');
|
||||||
}
|
}
|
||||||
@@ -549,12 +589,18 @@ export default {
|
|||||||
handlePublicChange,
|
handlePublicChange,
|
||||||
handleHotChange,
|
handleHotChange,
|
||||||
showCourseByTag,
|
showCourseByTag,
|
||||||
|
showCourseByTagg,
|
||||||
closeCourseDialog,
|
closeCourseDialog,
|
||||||
changeCoursePagination,
|
changeCoursePagination,
|
||||||
unbindCurrentTag,
|
unbindCurrentTag,
|
||||||
formatDate,
|
formatDate,
|
||||||
exportTag,
|
exportTag,
|
||||||
portalPageList
|
portalPageList,
|
||||||
|
changeTagPublic,
|
||||||
|
changeTagHot,
|
||||||
|
unbindCourseTagRelation,
|
||||||
|
searchTags,
|
||||||
|
createTag
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user