diff --git a/src/api/case.js b/src/api/case.js index 00b433a2..94acc9f7 100644 --- a/src/api/case.js +++ b/src/api/case.js @@ -10,6 +10,8 @@ export const isTopList = (data) => http.post('/xboe/m/boe/cases/isTopList', data }) //下载失败数据 export const downloadErrorData = (params) => http.get('/xboe/m/boe/cases/recommend/download', { params }) +//导入失败或成功返回的数据 +export const downloadErrorRecords = (params) => http.get('/xboe/m/boe/cases/recommend/import-info', { params }) //案例推荐导入 // export const uploadCaseData = (data, config) => http({ // method: 'POST', @@ -25,4 +27,6 @@ export const deleteResearch = (params) => http.get("xboe/m/boe/cases/recommend/d // 案例信息下载接口 export const caseInfoDownload = (params) => http.get('xboe/m/boe/cases/recommend/info_download', { params }) // 案例撤回接口 -export const rePushOrWithdraw = (data) => http.post('xboe/m/boe/cases/recommend/rePushOrWithdraw', data) \ No newline at end of file +export const rePushOrWithdraw = (data) => http.post('xboe/m/boe/cases/recommend/rePushOrWithdraw', data) +// 案例推荐 +export const caseRecommend = (data) => http.post('/xboe/m/boe/cases/recommend/launch', data) \ No newline at end of file diff --git a/src/components/CaseManage/CommonRecommend.vue b/src/components/CaseManage/CommonRecommend.vue index 204c7740..58e7a41c 100644 --- a/src/components/CaseManage/CommonRecommend.vue +++ b/src/components/CaseManage/CommonRecommend.vue @@ -299,12 +299,11 @@ import { USER_LIST_PAGE, AUDIENCE_LIST, } from "@/api/ThirdApi"; -import { - recommendLaunch, -} from "@/api/case"; import dialog from "@/utils/dialog"; import BaseTable from "@/components/common/BaseTable"; import { STUDENT_LIST } from "@/api/apis"; +// 推荐接口 +import { caseRecommend } from '@/api/case' const emit = defineEmits({}); const props = defineProps({ @@ -362,6 +361,7 @@ const props = defineProps({ }, }); + const projectSelectKeys = ref([]); const projectSelectRows = ref([]); const stuSelectRows = ref([]); @@ -377,9 +377,9 @@ const projectParams = ref({ pid: props.infoId, type: props.infoType, studentName const getProjectStu = () => projectStuTableRef.value.fetch(); const resetProjectStu = () => { console.log(111); - + console.log(props.id); - + projectParams.value.studentName = ""; projectStuTableRef.value.reset(); }; @@ -575,12 +575,16 @@ const closeChangeModal = () => { stageVisible.value = false; }; const openDrawer = () => { + if (!props.id.length) { + message.warning('请选择最少一个案例推送!!!') + return + } visiable.value = true; }; function onSearchStu() { console.log(props.id); - + stuTableRef.value.reset(nameSearch.value); } @@ -626,7 +630,7 @@ const resetAudienceInfo = () => { auditTableRef.value.reset({ keyword: "" }); }; -//推荐 +//推荐按钮 const submitAuth = () => { if (props.type === 2) { stageVisible.value = true; @@ -636,10 +640,15 @@ const submitAuth = () => { }; function handleDialogOk() { - if (auditSelectRowKeys.value.length || deptList.value.length) { - dialog({ content: "您选择了组织或受众,此添加为异步添加,请稍后手动刷新学员!", ok: handleStageOk }); - return; - } + // if (auditSelectRowKeys.value.length || deptList.value.length) { + // dialog({ content: "您选择了组织或受众,此添加为异步添加,请稍后手动刷新学员!", ok: handleStageOk }); + // return; + // } + console.log(props.id); + console.log(auditSelectRowKeys.value); + console.log(deptList.value); + + handleStageOk(); } @@ -651,10 +660,15 @@ function handleStageOk() { visiable.value = false; emit("finash", false); nameSearch.value.keyword = ""; - // recommendLaunch().then(() => { - // deleteDepSelect(); - // emit("finash", true); - // }) + caseRecommend({ + importId: props.id, + recommendOrgName:'' + }).then(() => { + deleteDepSelect(); + emit("finash", true); + }).catch(() => { + message.error("推荐失败"); + }) // saveStu({ // targetId: props.id, // type: props.type,