mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 10:56:46 +08:00
课程推荐
This commit is contained in:
@@ -60,3 +60,9 @@ export const studyRecordList = (obj) =>
|
|||||||
// 获取员工信息
|
// 获取员工信息
|
||||||
export const getMemberInfoApi = (obj) =>
|
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 recommend = (obj) =>
|
||||||
|
http.post("/recommend/recommend",obj)
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="filterItems">
|
<div class="filterItems">
|
||||||
<div class="pathnameInp">
|
<div class="pathnameInp">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="createName"
|
v-model:value="sysCreateBy"
|
||||||
style="width: 200px; height: 40px; border-radius: 8px"
|
style="width: 200px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入创建人"
|
placeholder="请输入创建人"
|
||||||
/>
|
/>
|
||||||
@@ -20,17 +20,7 @@
|
|||||||
placeholder="请输入名称"
|
placeholder="请输入名称"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="select">
|
|
||||||
<a-select
|
|
||||||
v-model:value="auditStatus"
|
|
||||||
dropdownClassName="dropdown-style"
|
|
||||||
style="width: 200px"
|
|
||||||
placeholder="请选择状态"
|
|
||||||
:options="options1"
|
|
||||||
allowClear
|
|
||||||
>
|
|
||||||
</a-select>
|
|
||||||
</div> -->
|
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
:getPopupContainer="
|
:getPopupContainer="
|
||||||
@@ -80,25 +70,9 @@
|
|||||||
>
|
>
|
||||||
<template #action="{ text, record, index }">
|
<template #action="{ text, record, index }">
|
||||||
<a-space :key="record.id">
|
<a-space :key="record.id">
|
||||||
<!-- <a-button
|
|
||||||
v-if="(record.auditStatus === 2 || record.auditStatus === 3) && !record.publishStatus && checkPer(record.permissions,createId)"
|
<a-button @click="() => handleOper(record,'withdraw',record.recommendStatus)" type="link">
|
||||||
@click="() => handlePush(text, index)"
|
<!-- {{ status[record.recommendStatus] }} -->
|
||||||
type="link"
|
|
||||||
>发布
|
|
||||||
</a-button>
|
|
||||||
<a-button
|
|
||||||
v-if="
|
|
||||||
(record.auditStatus === 1 || record.auditStatus === 2 || record.publishStatus) &&
|
|
||||||
record.status &&
|
|
||||||
checkPer(record.permissions,createId)
|
|
||||||
"
|
|
||||||
@click="() => handleRejectExit(text, index, record)"
|
|
||||||
type="link"
|
|
||||||
block
|
|
||||||
>撤回</a-button
|
|
||||||
> -->
|
|
||||||
<a-button @click="() => handleOper(record, record.publishStatus)" type="link">
|
|
||||||
{{ status[record.publishStatus] }}
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -134,7 +108,8 @@ import { useRouter, useRoute } from "vue-router";
|
|||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
import {
|
import {
|
||||||
list,
|
list,
|
||||||
handle,
|
page,
|
||||||
|
recommend
|
||||||
} from "@/api/indexCourse";
|
} from "@/api/indexCourse";
|
||||||
import {
|
import {
|
||||||
} from "../../utils/utils";
|
} from "../../utils/utils";
|
||||||
@@ -144,24 +119,42 @@ import { codeUrl, toDate } from "@/api/method";
|
|||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { checkPer, checkOwner } from "@/utils/utils";
|
import { checkPer, checkOwner } from "@/utils/utils";
|
||||||
|
|
||||||
const status = {
|
const status = {
|
||||||
1: "推荐",
|
1: "推荐",
|
||||||
2: "取消推荐",
|
2: "取消推荐",
|
||||||
3: "重新推送",
|
3: "重新推送",
|
||||||
}
|
}
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {},
|
components: {},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
// function handleOper(record, type, status = '') {
|
|
||||||
// dialog({ content: handleMsg[status ? type + status : type], ok: handle(record)[type] });
|
const handleMsg = {
|
||||||
// }
|
withdraw1: "你确认要撤回此次推送吗?",
|
||||||
|
withdraw2: "您确定要重新推送此案例吗?",
|
||||||
|
};
|
||||||
|
function handleOper(record, type, status = '') {
|
||||||
|
dialog({content: handleMsg[status ? type + status : type], ok: handle(record)[type] });
|
||||||
|
}
|
||||||
|
// const handle = (record) => ({
|
||||||
|
// withdraw: async () => {
|
||||||
|
// try {
|
||||||
|
// // editReleaseStatus({ assessmentId: record.id, releaseStatus: 1 });
|
||||||
|
// await recommend({ casesRecommendId: record.id });
|
||||||
|
// getTableDate();
|
||||||
|
// } catch (error) {
|
||||||
|
// message.info("推送失败!");
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const sysTypeOptions = computed(() => store.state.content_type);
|
const sysTypeOptions = computed(() => store.state.content_type);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
|
||||||
permissions:null,
|
|
||||||
createId:null,
|
total:0,
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
columns1: [
|
columns1: [
|
||||||
{
|
{
|
||||||
@@ -185,27 +178,27 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
title: "内容分类",
|
title: "内容分类",
|
||||||
width: 130,
|
width: 130,
|
||||||
dataIndex: "contentTxt",
|
dataIndex: "keywords",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
key: "contentTxt",
|
key: "keywords",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ record }) =>
|
customRender: ({ record }) =>
|
||||||
findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
|
findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "关键字",
|
title: "关键字",
|
||||||
dataIndex: "tips",
|
dataIndex: "value",
|
||||||
key: "tips",
|
key: "value",
|
||||||
align: "left",
|
align: "left",
|
||||||
customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}},
|
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
return <a-tooltip placement="topLeft" title = {text} >{text ? text : "-"}</a-tooltip>
|
return text ? text : "-"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "创建人",
|
title: "创建人",
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: "createName",
|
dataIndex: "sysCreateBy",
|
||||||
key: "8",
|
key: "8",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
@@ -216,7 +209,7 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
title: "创建时间",
|
title: "创建时间",
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: "createTime",
|
dataIndex: "sysCreateTime",
|
||||||
key: "9",
|
key: "9",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
@@ -228,48 +221,18 @@ export default defineComponent({
|
|||||||
title: "推荐时间",
|
title: "推荐时间",
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
dataIndex: "publishTime",
|
dataIndex: "recommendTime",
|
||||||
key: "10",
|
key: "10",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ text, publishStatus }) => {
|
customRender: ({ text, recommendStatus }) => {
|
||||||
return publishStatus? text || "-" : "-";
|
return recommendStatus? text || "-" : "-";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "是否推荐",
|
||||||
width: 130,
|
|
||||||
dataIndex: "auditStatus",
|
|
||||||
key: "6",
|
|
||||||
align: "center",
|
|
||||||
customRender: ({ record }) => {
|
|
||||||
switch (String(record.auditStatus)) {
|
|
||||||
case "0":
|
|
||||||
return "未提交";
|
|
||||||
case "1":
|
|
||||||
return "待审核";
|
|
||||||
case "2":
|
|
||||||
return "已审核";
|
|
||||||
case "3":
|
|
||||||
return "已审核";
|
|
||||||
case "-1":
|
|
||||||
return "审核未通过";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: "是否推荐",
|
|
||||||
// width: 100,
|
|
||||||
// dataIndex: "publishStatus",
|
|
||||||
// key: "7",
|
|
||||||
// align: "center",
|
|
||||||
// customRender: ({ record }) =>
|
|
||||||
// record.publishStatus? "已发布" : "未发布",
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
title: "推送进度",
|
|
||||||
dataIndex: "publishStatus",
|
|
||||||
key: "publishStatus",
|
|
||||||
width: 100,
|
width: 100,
|
||||||
|
dataIndex: "recommendStatus",
|
||||||
|
key: "7",
|
||||||
align: "center",
|
align: "center",
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
switch (text) {
|
switch (text) {
|
||||||
@@ -288,6 +251,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 100,
|
width: 100,
|
||||||
@@ -304,10 +268,9 @@ export default defineComponent({
|
|||||||
tableDataTotal1: -1,
|
tableDataTotal1: -1,
|
||||||
pageSize1: 10,
|
pageSize1: 10,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
projectName: "",
|
|
||||||
name: "",
|
name: "",
|
||||||
createName: "",
|
createName: "",
|
||||||
auditStatus: null,
|
sysCreateBy:"",
|
||||||
sysTypeId: undefined,
|
sysTypeId: undefined,
|
||||||
codeUrl: codeUrl,
|
codeUrl: codeUrl,
|
||||||
selectedRowKeys:[], //标题ID
|
selectedRowKeys:[], //标题ID
|
||||||
@@ -346,8 +309,7 @@ export default defineComponent({
|
|||||||
const getTableDate = async () => {
|
const getTableDate = async () => {
|
||||||
state.tableLoading = true;
|
state.tableLoading = true;
|
||||||
console.log("我是点击搜索的数据", state.sysTypeId);
|
console.log("我是点击搜索的数据", state.sysTypeId);
|
||||||
let startTime = "";
|
|
||||||
let endTime = "";
|
|
||||||
if (state.projectTime) {
|
if (state.projectTime) {
|
||||||
startTime = toDate(
|
startTime = toDate(
|
||||||
new Date(state.projectTime[0].$d).getTime() / 1000,
|
new Date(state.projectTime[0].$d).getTime() / 1000,
|
||||||
@@ -358,32 +320,26 @@ export default defineComponent({
|
|||||||
"Y-M-D"
|
"Y-M-D"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let res = await list({
|
let res = await page({
|
||||||
pageNo: state.currentPage1,
|
|
||||||
pageSize: state.pageSize1,
|
pageNum:state.currentPage1,
|
||||||
auditStatus: state.auditStatus,
|
pageSize:state.pageSize1,
|
||||||
|
sysCreateBy:state.sysCreateBy,
|
||||||
sysTypeId: state.sysTypeId,
|
sysTypeId: state.sysTypeId,
|
||||||
projectName: state.projectName,
|
name:state.name,
|
||||||
name: state.name,
|
|
||||||
createName: state.createName,
|
|
||||||
endTime: endTime,
|
|
||||||
beginTime: startTime,
|
|
||||||
});
|
});
|
||||||
const { rows, total } = res.data.data;
|
const { records, total } = res.data.data;
|
||||||
state.tableData1 = rows;
|
state.tableData1 = records;
|
||||||
state.tableDataTotal1 = total;
|
state.tableDataTotal1 = total;
|
||||||
state.tableLoading = false;
|
state.tableLoading = false;
|
||||||
console.log("state.tableData1", state.tableData1);
|
console.log("state.tableData1", state.tableData1);
|
||||||
};
|
};
|
||||||
getTableDate();
|
getTableDate();
|
||||||
|
|
||||||
// 计算全选
|
// 计算全选
|
||||||
const rowSelection = computed(() => {
|
const rowSelection = computed(() => {
|
||||||
return {
|
return {
|
||||||
selectedRowKeys: state.selectedRowKeys,
|
selectedRowKeys: state.selectedRowKeys,
|
||||||
onChange: onSelectChange,
|
onChange: onSelectChange,
|
||||||
// preserveSelectedRowKeys: true,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//计算出来已选中状态
|
//计算出来已选中状态
|
||||||
@@ -408,10 +364,9 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
//重置
|
//重置
|
||||||
const handleRest1 = () => {
|
const handleRest1 = () => {
|
||||||
state.projectName = "";
|
|
||||||
state.name = "";
|
state.name = "";
|
||||||
state.createName = "";
|
state.createName = "";
|
||||||
state.auditStatus = null;
|
state.sysCreateBy = '';
|
||||||
state.sysTypeId = null;
|
state.sysTypeId = null;
|
||||||
state.projectTime = "";
|
state.projectTime = "";
|
||||||
getTableDate();
|
getTableDate();
|
||||||
@@ -445,37 +400,14 @@ export default defineComponent({
|
|||||||
label: "已完成",
|
label: "已完成",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
//撤回
|
|
||||||
const handleRejectExit = (id, index, record) => {
|
|
||||||
dialog({
|
|
||||||
content: "确定撤回吗?",
|
|
||||||
ok: () => {
|
|
||||||
message.success("撤回成功");
|
|
||||||
record.publishStatus ? (state.tableData1[index].publishStatus = 0) : (state.tableData1[index].auditStatus = 0);
|
|
||||||
handle({ offcourseId: id, type: 0 });
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
//发布
|
|
||||||
const handlePush = (id, index) => {
|
|
||||||
dialog({
|
|
||||||
content: "确定发布该课程吗?",
|
|
||||||
ok: () => {
|
|
||||||
message.success("发布成功");
|
|
||||||
state.tableData1[index].publishStatus = 1;
|
|
||||||
handle({ offcourseId: id, type: 3 });
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
sysTypeOptions,
|
// sysTypeOptions,
|
||||||
findClassFullName,
|
findClassFullName,
|
||||||
moment,
|
moment,
|
||||||
handlePush,
|
|
||||||
options1,
|
options1,
|
||||||
options11,
|
options11,
|
||||||
handleRejectExit,
|
|
||||||
mode: "simple",
|
mode: "simple",
|
||||||
handelChangePage1,
|
handelChangePage1,
|
||||||
handleSearch1,
|
handleSearch1,
|
||||||
@@ -485,7 +417,8 @@ export default defineComponent({
|
|||||||
rowSelection,
|
rowSelection,
|
||||||
onSelectChange,
|
onSelectChange,
|
||||||
status,
|
status,
|
||||||
// handleOper
|
handleOper,
|
||||||
|
// handle,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -647,3 +580,4 @@ export default defineComponent({
|
|||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user