mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
课程推荐
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import http from "./config";
|
import http from "./config";
|
||||||
|
import Http from './configPublic'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1
|
* 1
|
||||||
@@ -62,7 +63,7 @@ export const getMemberInfoApi = (obj) =>
|
|||||||
http.post("/admin/orgStruct/getMemberInfo", obj);
|
http.post("/admin/orgStruct/getMemberInfo", obj);
|
||||||
|
|
||||||
//课程推荐列表
|
//课程推荐列表
|
||||||
export const page = (params) => http.get("/recommend/page",{params})
|
export const page = (obj) => http.post("/recommend/page",obj)
|
||||||
//课程推荐或撤回推荐
|
//课程推荐或撤回推荐
|
||||||
export const recommend = (obj) =>
|
export const recommend = (obj) =>
|
||||||
http.post("/recommend/recommend",obj)
|
Http.post("/manageApi/recommend/recommend",obj)
|
||||||
@@ -6,21 +6,6 @@
|
|||||||
<!-- 搜索框及按钮 -->
|
<!-- 搜索框及按钮 -->
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<div class="filterItems">
|
<div class="filterItems">
|
||||||
<div class="pathnameInp">
|
|
||||||
<a-input
|
|
||||||
v-model:value="sysCreateBy"
|
|
||||||
style="width: 200px; height: 40px; border-radius: 8px"
|
|
||||||
placeholder="请输入创建人"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="pathnameInp">
|
|
||||||
<a-input
|
|
||||||
v-model:value="name"
|
|
||||||
style="width: 200px; height: 40px; border-radius: 8px"
|
|
||||||
placeholder="请输入名称"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
|
|
||||||
@@ -31,11 +16,30 @@
|
|||||||
placeholder="请选择内容分类"
|
placeholder="请选择内容分类"
|
||||||
allow-clear
|
allow-clear
|
||||||
tree-default-expand-all
|
tree-default-expand-all
|
||||||
|
:fieldNames="{
|
||||||
|
children: 'children',
|
||||||
|
label: 'name',
|
||||||
|
value: 'code',
|
||||||
|
}"
|
||||||
:tree-data="sysTypeOptions"
|
:tree-data="sysTypeOptions"
|
||||||
>
|
>
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="pathnameInp">
|
||||||
|
<a-input
|
||||||
|
v-model:value="sysCreateBy"
|
||||||
|
style="width: 200px; height: 40px; border-radius: 8px"
|
||||||
|
placeholder="授课教师"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="pathnameInp">
|
||||||
|
<a-input
|
||||||
|
v-model:value="name"
|
||||||
|
style="width: 200px; height: 40px; border-radius: 8px"
|
||||||
|
placeholder="名称"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style="display: flex; margin-bottom: 20px" class="courseBtn">
|
<div style="display: flex; margin-bottom: 20px" class="courseBtn">
|
||||||
<div class="btn btn1" @click="handleSearch1">
|
<div class="btn btn1" @click="handleSearch1">
|
||||||
<div class="search"></div>
|
<div class="search"></div>
|
||||||
@@ -56,22 +60,23 @@
|
|||||||
:header-cell-style="{ 'text-align': 'center' }"
|
:header-cell-style="{ 'text-align': 'center' }"
|
||||||
style="border: 1px solid #f2f6fe"
|
style="border: 1px solid #f2f6fe"
|
||||||
:columns="columns1"
|
:columns="columns1"
|
||||||
:data-source="data"
|
:data-source="tableData1"
|
||||||
:loading="tableLoading"
|
:loading="tableLoading"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
:scroll="{ x: 'max-content' }"
|
:scroll="{ x: 'max-content' }"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
>
|
>
|
||||||
<template #action="{ text, record, index }">
|
<template #actions="{ text, record, index }">
|
||||||
<a-space :key="record.id">
|
<a-space :key="record.id">
|
||||||
|
|
||||||
<!-- <a-button @click="() => handleOper(record,'withdraw',record.recommendStatus)" type="link">
|
<a-button @click="() => handleOper(record,'withdraw',record.recommendStatus)" type="link">
|
||||||
{{ status[record.recommendStatus] }}
|
{{ status[record.recommendStatus] }}
|
||||||
</a-button> -->
|
|
||||||
<a-button @click="() => handleOper(record, 'withdraw', record.pushProgress)" type="link">
|
|
||||||
{{ status[record.pushProgress] }}
|
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<!-- <a-button @click="() => handleOper(record, 'withdraw', record.pushProgress)" type="link">
|
||||||
|
{{ status[record.pushProgress] }}
|
||||||
|
</a-button> -->
|
||||||
|
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
@@ -127,93 +132,94 @@ const searchData = ref({
|
|||||||
recommendTimeList: [],
|
recommendTimeList: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const sysTypeOptions = [
|
// const sysTypeOptions = [
|
||||||
{
|
// {
|
||||||
title: '专业类',
|
// title: '专业类',
|
||||||
value: '0',
|
// value: '0',
|
||||||
key: '0',
|
// key: '0',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '领导力',
|
// title: '领导力',
|
||||||
value: '1',
|
// value: '1',
|
||||||
key: '1',
|
// key: '1',
|
||||||
},
|
// },
|
||||||
];
|
// ];
|
||||||
const status = {
|
const status = reactive({
|
||||||
1: "撤回",
|
0:'推荐',
|
||||||
2: "撤回",
|
1:'取消推荐',
|
||||||
3: "撤回",
|
2:'重新推荐'
|
||||||
4: "重新推送",
|
})
|
||||||
5: "重新推送",
|
const data = []
|
||||||
}
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {},
|
components: {},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
|
||||||
const handleMsg = {
|
const handleMsg = {
|
||||||
withdraw1: "你确认要撤回此次推送吗?",
|
withdraw1: "课程已被推荐,点击可以取消推荐",
|
||||||
withdraw2: "你确认要撤回此次推送吗?",
|
withdraw: "课程未被推荐,点击可以设为推荐",
|
||||||
withdraw3: "你确认要撤回此次推送吗?",
|
|
||||||
withdraw4: "您确定要重新推送此案例吗?",
|
|
||||||
withdraw5: "您确定要重新推送此案例吗?",
|
|
||||||
};
|
};
|
||||||
function handleOper(record, type, status = '') {
|
function handleOper(record, type, status = '') {
|
||||||
dialog({content: handleMsg[status ? type + status : type], ok: handle(record)[type] });
|
dialog({content: handleMsg[status ? type + status : type], ok: recommends(record)[type] });
|
||||||
}
|
}
|
||||||
const getList = (num) => {
|
|
||||||
if (num === 1) searchData.value.pageIndex = 1;
|
|
||||||
boeRequest(RECOMMEND_PAGE, searchData.value)
|
|
||||||
.then((res) => {
|
|
||||||
state.tableLoading = false;
|
|
||||||
state.data = res?.result?.list || [];
|
|
||||||
state.total = res?.result?.count || 0;
|
|
||||||
console.log('推送数据',state.data)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
state.tableLoading = true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取列表数据
|
const recommends = (record) => ({
|
||||||
getList();
|
|
||||||
const handle = (record) => ({
|
|
||||||
withdraw: async () => {
|
withdraw: async () => {
|
||||||
try {
|
try {
|
||||||
await rePushOrWithdraw({ casesRecommendId: record.id });
|
await recommend({ courseId: record.id });
|
||||||
getList();
|
console.log('recommendStatus',state.tableData1[0].recommendStatus)
|
||||||
|
getTableDate();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.info("推送失败!");
|
message.info("推送失败!");
|
||||||
|
console.log('record.id',record.id)
|
||||||
|
console.log('recommend',record)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
|
||||||
// const handle = (record) => ({
|
|
||||||
// withdraw: async () => {
|
|
||||||
// try {
|
|
||||||
// await recommend({ casesRecommendId: record.id });
|
|
||||||
// getTableDate();
|
|
||||||
// } catch (error) {
|
|
||||||
// message.info("推送失败!");
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
// });
|
});
|
||||||
|
//内容分类
|
||||||
|
function findClassFullName(list, classify, name = "") {
|
||||||
|
return (
|
||||||
|
(list &&
|
||||||
|
list.length > 0 &&
|
||||||
|
list
|
||||||
|
.map((e) =>
|
||||||
|
classify == e.code
|
||||||
|
? name
|
||||||
|
? name + "-" + e.name
|
||||||
|
: e.name
|
||||||
|
: findClassFullName(
|
||||||
|
e.children,
|
||||||
|
classify,
|
||||||
|
name ? name + "-" + e.name : e.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.filter((name) => name)
|
||||||
|
.join("")) ||
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
// const sysTypeOptions = computed(() => store.state.content_type);
|
const sysTypeOptions = computed(() => {console.log('sysTypeOptions',sysTypeOptions);return store.state.content_type;});
|
||||||
|
console.log(sysTypeOptions,'闽侯阿加佳偶');
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
//测试
|
//测试
|
||||||
data:[],
|
// data:[],
|
||||||
|
|
||||||
total:0,
|
total:0,
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
columns1: [
|
columns1: [
|
||||||
{
|
{
|
||||||
title: "序号",
|
title: "序号",
|
||||||
width: 130,
|
width: 50,
|
||||||
dataIndex: "offcourseNumber",
|
dataIndex: "xuhaoid",
|
||||||
key: "offcourseNumber",
|
key: "xuhaoid",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
customRender: ({ text,record,index }) => {
|
||||||
|
return index+1
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "名称",
|
title: "名称",
|
||||||
@@ -223,32 +229,35 @@ export default defineComponent({
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: "left",
|
align: "left",
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
return text ? text : "-";
|
return `${text.length>12?text.slice(0,12)+'...':text}`
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "内容分类",
|
title: "内容分类",
|
||||||
width: 130,
|
width: 200,
|
||||||
dataIndex: "keywords",
|
dataIndex: "keywords",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
key: "keywords",
|
key: "keywords",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ record }) =>
|
customRender: ({ record }) =>
|
||||||
findClassFullName( record.sysTypeId) || "-",
|
findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
|
||||||
// findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
|
// customRender: ({ text }) => {
|
||||||
|
// return text ? text : "-";
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "关键字",
|
title: "关键字",
|
||||||
dataIndex: "value",
|
dataIndex: "keywords",
|
||||||
key: "value",
|
key: "keywords",
|
||||||
align: "left",
|
align: "left",
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
return text ? text : "-"
|
return text.length>12?text.slice(0,12)+'...':text
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "创建人",
|
title: "授课教师",
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: "sysCreateBy",
|
dataIndex: "sysCreateBy",
|
||||||
key: "8",
|
key: "8",
|
||||||
@@ -276,58 +285,28 @@ export default defineComponent({
|
|||||||
dataIndex: "recommendTime",
|
dataIndex: "recommendTime",
|
||||||
key: "10",
|
key: "10",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ text, recommendStatus }) => {
|
customRender: ({ text, record }) => {
|
||||||
return recommendStatus? text || "-" : "-";
|
return record.recommendStatus? text || "-" : "-";
|
||||||
|
// return text ? text : "-";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: "是否推荐",
|
|
||||||
// width: 100,
|
|
||||||
// dataIndex: "recommendStatus",
|
|
||||||
// key: "7",
|
|
||||||
// align: "center",
|
|
||||||
// customRender: ({ text }) => {
|
|
||||||
// switch (text) {
|
|
||||||
// case 1:
|
|
||||||
// return <span>推送中</span>;
|
|
||||||
// case 2:
|
|
||||||
// return <span>推送中</span>;
|
|
||||||
// case 3:
|
|
||||||
// return <span>已完成</span>;
|
|
||||||
// case 4:
|
|
||||||
// return <span style={{ color: "red" }}>推送失败</span>;
|
|
||||||
// case 5:
|
|
||||||
// return <span>推送撤回</span>;
|
|
||||||
// default:
|
|
||||||
// return <span>-</span>;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: "推送进度",
|
title: "是否推荐",
|
||||||
dataIndex: "pushProgress",
|
width: 100,
|
||||||
key: "pushProgress",
|
dataIndex: "recommendStatus",
|
||||||
width: "10%",
|
key: "recommendStatus",
|
||||||
align: "center",
|
align: "center",
|
||||||
className: "h",
|
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
switch (text) {
|
switch (text) {
|
||||||
|
case 0:
|
||||||
|
return <span>未推荐</span>;
|
||||||
case 1:
|
case 1:
|
||||||
return <span>推送中</span>;
|
return <span>已推荐</span>;
|
||||||
case 2:
|
|
||||||
return <span>推送中</span>;
|
|
||||||
case 3:
|
|
||||||
return <span>已完成</span>;
|
|
||||||
case 4:
|
|
||||||
return <span style={{ color: "red" }}>推送失败</span>;
|
|
||||||
case 5:
|
|
||||||
return <span>推送撤回</span>;
|
|
||||||
default:
|
default:
|
||||||
return <span>-</span>;
|
return <span>-</span>;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 100,
|
width: 100,
|
||||||
@@ -335,7 +314,7 @@ export default defineComponent({
|
|||||||
key: "id",
|
key: "id",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
align: "center",
|
align: "center",
|
||||||
slots: { customRender: "action" },
|
slots: { customRender: "actions" },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
//列表表格
|
//列表表格
|
||||||
@@ -347,34 +326,15 @@ export default defineComponent({
|
|||||||
name: "",
|
name: "",
|
||||||
createName: "",
|
createName: "",
|
||||||
sysCreateBy:"",
|
sysCreateBy:"",
|
||||||
|
sysType1:"", //内容分类
|
||||||
|
sysType2:"",
|
||||||
|
sysType3:"",
|
||||||
sysTypeId: undefined,
|
sysTypeId: undefined,
|
||||||
codeUrl: codeUrl,
|
codeUrl: codeUrl,
|
||||||
selectedRowKeys:[], //标题ID
|
selectedRowKeys:[], //标题ID
|
||||||
caseTitleList:[],
|
caseTitleList:[],
|
||||||
selectedRow:[], //选组的每一行数据
|
selectedRow:[], //选组的每一行数据
|
||||||
});
|
});
|
||||||
//内容分类
|
|
||||||
function findClassFullName(list, classify, name = "") {
|
|
||||||
return (
|
|
||||||
(list &&
|
|
||||||
list.length > 0 &&
|
|
||||||
list
|
|
||||||
.map((e) =>
|
|
||||||
classify == e.code
|
|
||||||
? name
|
|
||||||
? name + "-" + e.name
|
|
||||||
: e.name
|
|
||||||
: findClassFullName(
|
|
||||||
e.children,
|
|
||||||
classify,
|
|
||||||
name ? name + "-" + e.name : e.name
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.filter((name) => name)
|
|
||||||
.join("")) ||
|
|
||||||
""
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
console.log(route);
|
console.log(route);
|
||||||
@@ -403,6 +363,9 @@ export default defineComponent({
|
|||||||
sysCreateBy:state.sysCreateBy,
|
sysCreateBy:state.sysCreateBy,
|
||||||
sysTypeId: state.sysTypeId,
|
sysTypeId: state.sysTypeId,
|
||||||
name:state.name,
|
name:state.name,
|
||||||
|
sysType1:state.sysType1,
|
||||||
|
sysType2:state.sysType2,
|
||||||
|
sysType3:state.sysType3,
|
||||||
});
|
});
|
||||||
const { records, total } = res.data.data;
|
const { records, total } = res.data.data;
|
||||||
state.tableData1 = records;
|
state.tableData1 = records;
|
||||||
@@ -494,13 +457,17 @@ export default defineComponent({
|
|||||||
onSelectChange,
|
onSelectChange,
|
||||||
status,
|
status,
|
||||||
handleOper,
|
handleOper,
|
||||||
handle,
|
searchData,
|
||||||
searchData
|
recommends,
|
||||||
|
data,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
:deep(.ant-table-cell-fix-right){
|
||||||
|
width: 100px !important;
|
||||||
|
}
|
||||||
.courseManage {
|
.courseManage {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user