diff --git a/src/api/indexCourse.js b/src/api/indexCourse.js
index 2cd8870e..13e912cb 100644
--- a/src/api/indexCourse.js
+++ b/src/api/indexCourse.js
@@ -1,4 +1,5 @@
import http from "./config";
+import Http from './configPublic'
/**
* 1
@@ -62,7 +63,7 @@ export const getMemberInfoApi = (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) =>
- http.post("/recommend/recommend",obj)
\ No newline at end of file
+Http.post("/manageApi/recommend/recommend",obj)
\ No newline at end of file
diff --git a/src/views/courselibrary/CourseRecommended.vue b/src/views/courselibrary/CourseRecommended.vue
index 33ee220d..65aa27a4 100644
--- a/src/views/courselibrary/CourseRecommended.vue
+++ b/src/views/courselibrary/CourseRecommended.vue
@@ -6,21 +6,6 @@
-
-
-
+
+
+
@@ -56,22 +60,23 @@
:header-cell-style="{ 'text-align': 'center' }"
style="border: 1px solid #f2f6fe"
:columns="columns1"
- :data-source="data"
+ :data-source="tableData1"
:loading="tableLoading"
:pagination="false"
:row-selection="rowSelection"
:scroll="{ x: 'max-content' }"
row-key="id"
>
-
+
-
- handleOper(record, 'withdraw', record.pushProgress)" type="link">
- {{ status[record.pushProgress] }}
+
+
@@ -127,93 +132,94 @@ const searchData = ref({
recommendTimeList: [],
});
-const sysTypeOptions = [
- {
- title: '专业类',
- value: '0',
- key: '0',
- },
- {
- title: '领导力',
- value: '1',
- key: '1',
- },
-];
-const status = {
- 1: "撤回",
- 2: "撤回",
- 3: "撤回",
- 4: "重新推送",
- 5: "重新推送",
- }
+// const sysTypeOptions = [
+// {
+// title: '专业类',
+// value: '0',
+// key: '0',
+// },
+// {
+// title: '领导力',
+// value: '1',
+// key: '1',
+// },
+// ];
+const status = reactive({
+ 0:'推荐',
+ 1:'取消推荐',
+ 2:'重新推荐'
+})
+const data = []
+
export default defineComponent({
components: {},
setup() {
-
+
const handleMsg = {
- withdraw1: "你确认要撤回此次推送吗?",
- withdraw2: "你确认要撤回此次推送吗?",
- withdraw3: "你确认要撤回此次推送吗?",
- withdraw4: "您确定要重新推送此案例吗?",
- withdraw5: "您确定要重新推送此案例吗?",
+ withdraw1: "课程已被推荐,点击可以取消推荐",
+ withdraw: "课程未被推荐,点击可以设为推荐",
};
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;
- });
- };
-
- // 获取列表数据
- getList();
- const handle = (record) => ({
+
+ const recommends = (record) => ({
withdraw: async () => {
try {
- await rePushOrWithdraw({ casesRecommendId: record.id });
- getList();
+ await recommend({ courseId: record.id });
+ console.log('recommendStatus',state.tableData1[0].recommendStatus)
+ getTableDate();
} catch (error) {
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 sysTypeOptions = computed(() => store.state.content_type);
+ const sysTypeOptions = computed(() => {console.log('sysTypeOptions',sysTypeOptions);return store.state.content_type;});
+ console.log(sysTypeOptions,'闽侯阿加佳偶');
const state = reactive({
//测试
- data:[],
+ // data:[],
total:0,
tableLoading: false,
columns1: [
{
title: "序号",
- width: 130,
- dataIndex: "offcourseNumber",
- key: "offcourseNumber",
+ width: 50,
+ dataIndex: "xuhaoid",
+ key: "xuhaoid",
align: "center",
+ customRender: ({ text,record,index }) => {
+ return index+1
+ },
},
{
title: "名称",
@@ -223,32 +229,35 @@ export default defineComponent({
ellipsis: true,
align: "left",
customRender: ({ text }) => {
- return text ? text : "-";
+ return `${text.length>12?text.slice(0,12)+'...':text}`
+
},
+
},
{
title: "内容分类",
- width: 130,
+ width: 200,
dataIndex: "keywords",
ellipsis: true,
key: "keywords",
align: "center",
customRender: ({ record }) =>
- findClassFullName( record.sysTypeId) || "-",
- // findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
-
+ findClassFullName(sysTypeOptions.value, record.sysTypeId) || "-",
+ // customRender: ({ text }) => {
+ // return text ? text : "-";
+ // },
},
{
title: "关键字",
- dataIndex: "value",
- key: "value",
+ dataIndex: "keywords",
+ key: "keywords",
align: "left",
customRender: ({ text }) => {
- return text ? text : "-"
+ return text.length>12?text.slice(0,12)+'...':text
},
},
{
- title: "创建人",
+ title: "授课教师",
width: 100,
dataIndex: "sysCreateBy",
key: "8",
@@ -276,58 +285,28 @@ export default defineComponent({
dataIndex: "recommendTime",
key: "10",
align: "center",
- customRender: ({ text, recommendStatus }) => {
- return recommendStatus? text || "-" : "-";
+ customRender: ({ text, record }) => {
+ return record.recommendStatus? text || "-" : "-";
+ // return text ? text : "-";
},
},
- // {
- // title: "是否推荐",
- // width: 100,
- // dataIndex: "recommendStatus",
- // key: "7",
- // align: "center",
- // customRender: ({ text }) => {
- // switch (text) {
- // case 1:
- // return 推送中;
- // case 2:
- // return 推送中;
- // case 3:
- // return 已完成;
- // case 4:
- // return 推送失败;
- // case 5:
- // return 推送撤回;
- // default:
- // return -;
- // }
- // },
- // },
{
- title: "推送进度",
- dataIndex: "pushProgress",
- key: "pushProgress",
- width: "10%",
+ title: "是否推荐",
+ width: 100,
+ dataIndex: "recommendStatus",
+ key: "recommendStatus",
align: "center",
- className: "h",
customRender: ({ text }) => {
switch (text) {
+ case 0:
+ return 未推荐;
case 1:
- return 推送中;
- case 2:
- return 推送中;
- case 3:
- return 已完成;
- case 4:
- return 推送失败;
- case 5:
- return 推送撤回;
+ return 已推荐;
default:
return -;
}
},
},
-
{
title: "操作",
width: 100,
@@ -335,7 +314,7 @@ export default defineComponent({
key: "id",
fixed: "right",
align: "center",
- slots: { customRender: "action" },
+ slots: { customRender: "actions" },
},
],
//列表表格
@@ -347,34 +326,15 @@ export default defineComponent({
name: "",
createName: "",
sysCreateBy:"",
+ sysType1:"", //内容分类
+ sysType2:"",
+ sysType3:"",
sysTypeId: undefined,
codeUrl: codeUrl,
selectedRowKeys:[], //标题ID
caseTitleList:[],
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();
console.log(route);
@@ -403,6 +363,9 @@ export default defineComponent({
sysCreateBy:state.sysCreateBy,
sysTypeId: state.sysTypeId,
name:state.name,
+ sysType1:state.sysType1,
+ sysType2:state.sysType2,
+ sysType3:state.sysType3,
});
const { records, total } = res.data.data;
state.tableData1 = records;
@@ -494,13 +457,17 @@ export default defineComponent({
onSelectChange,
status,
handleOper,
- handle,
- searchData
+ searchData,
+ recommends,
+ data,
};
},
});
-