diff --git a/.env b/.env index 5abc8902..336ea0dd 100644 --- a/.env +++ b/.env @@ -2,6 +2,8 @@ VUE_APP_BASE=/manage # api项目基础url VUE_APP_BASE_API=/manageApi +# systemApi +VUE_APP_SYS_API=/systemapi #文件路径 VUE_APP_FILE_PATH=/upload/ # 代理url 本地调试,不可以用在其他地方 diff --git a/src/api/case.js b/src/api/case.js new file mode 100644 index 00000000..affec704 --- /dev/null +++ b/src/api/case.js @@ -0,0 +1,36 @@ +import http from "./configSys"; +import httpUserbase from './confign' + +// 案例列表 +export const RECOMMEND_PAGE = "/systemapi/xboe/m/boe/cases/recommend/page post"; +//发起案例列表或案例管理列表 +export const isTopList = (data) => http.post('/xboe/m/boe/cases/isTopList', data, { + headers: { + 'Content-Type': 'multipart/form-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', +// url: '/xboe/m/boe/cases/recommend/import', +// data, +// ...config, +// headers: { "Content-Type": "multipart/form-data" }, +// }) +// 案例删除接口deleteResearch +export const deleteResearch = (params) => http.get("xboe/m/boe/cases/recommend/delete", { params }); +// 案例信息下载接口 +export const caseInfoDownload = (data) => http.post('xboe/m/boe/cases/recommend/info_download', data, { responseType: 'blob' }) +// 案例撤回接口 +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,{ + timeout:20000 +}) + +//案例推荐选人的查询列表 +export const userList = (data) => httpUserbase.post('/user/list', data) \ No newline at end of file diff --git a/src/api/configSys.js b/src/api/configSys.js new file mode 100644 index 00000000..d5676330 --- /dev/null +++ b/src/api/configSys.js @@ -0,0 +1,70 @@ + +import {message} from "ant-design-vue"; +import axios from "axios"; +import router from "@/router"; +import Cookies from 'vue-cookies' +// import { getCookie } from '../api/method' +// const Qs = require("qs"); + +// axios.defaults.headers.post["Content-Type"] = +// "application/x-www-form-urlencoded"; +// export const FILE_UPLOAD_URL = process.env.VUE_APP_BASE_API + '/file/upload' +// export const BATCH_IMPORT_SCORE = process.env.VUE_APP_BASE_API + '/admin/offcourse/batchImportScore' +axios.defaults.withCredentials = true; +const http = axios.create({ + baseURL: process.env.VUE_APP_SYS_API, + timeout: 1000 * 15, + headers: {"Content-Type": "application/json",}, +}); + +http.interceptors.request.use( + (config) => { + const token = Cookies.get("token") + if (token) { + config.headers.token = token; //测试1111 + } else{ + message.error('未获取到登录信息,请先登录') + } + return config; + }, + (err) => { + console.log("登陆前拦截", err); + return Promise.reject(err); + } +); + +http.interceptors.response.use( + (response) => { + // console.log('response', response) + const { + data: {code}, + } = response; + if (code === 0 || code === 200) { + return response.data?response.data:response; + } + if(code==500){ + return message.error('请求失败'); + } + if(code==601){ + message.error('token过期请重新登陆'); + } + if (code === 1000) { + (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: 'login'}) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + return Promise.reject(response); + } + // show && message.error(msg); + // console.log("api %o", msg); + // return Promise.reject(response); + return response + }, + function (error) { + if (error.message == "timeout of 1ms exceeded") { + message.destroy(); + message.error("请求超时"); + } + console.log("api error %o", error); + return message.error(error.message); + } +); + +export default http; diff --git a/src/components/BreadCrumb.vue b/src/components/BreadCrumb.vue index a6de38c6..20246bd7 100644 --- a/src/components/BreadCrumb.vue +++ b/src/components/BreadCrumb.vue @@ -413,8 +413,22 @@ export default { ) { state.list = [ { - name: "案例管理", - }, + name: "案例", + }, { + name:'案例管理' + } + ]; + } + if ( + n.indexOf("/caserecommended") !== -1 || + n.indexOf("/CaseRecommended") !== -1 + ) { + state.list = [ + { + name: "案例", + }, { + name:'案例推荐' + } ]; } if ( diff --git a/src/components/CaseManage/CommonRecommend.vue b/src/components/CaseManage/CommonRecommend.vue new file mode 100644 index 00000000..0411d44c --- /dev/null +++ b/src/components/CaseManage/CommonRecommend.vue @@ -0,0 +1,1127 @@ + + + + + + \ No newline at end of file diff --git a/src/components/NavLeft.vue b/src/components/NavLeft.vue index 70ab77e6..73f79e58 100644 --- a/src/components/NavLeft.vue +++ b/src/components/NavLeft.vue @@ -174,26 +174,26 @@ 评估管理 - - - - - - - - - - - - - - - - - - - - +
考试管理 - + + + + + + + + + 案例管理 + + + + 案例推荐 + + + +
+ + +
+
+
+ +
+
+ +
+
+
+ +
搜索
+
+
+ +
重置
+
+
+
+
导入
+
+
+
+
+
已选择 {{ selectNum }} + + 条案例
+
已导入 + {{ state.caseTitleList.length }} 条案例
+
+
+ +
+
+ +
+
+
+
+
已选
+
+
+
+
+
+
+
+ {{ item.title.length > 6 ? item.title.slice(0, 6) + '...' : item.title }} +
+
+
+
+
+
+ {{ item.title.length > 6 ? item.title.slice(0, 6) + '...' : item.title }} +
+
+
+
+
+
+
查看更多>
+
+
+
收起<
+
+
+
+
+
+ +
+ + + + 下一步 + + +
+
+ + +
+
+ 导入 +
+
+ 下载导入模版 +
+
+
+
+ 下载最新案例列表 +
+
+
+
+ + + 上传文件 + + + 支持文件格式:.xls/.xlsx +
+
+
+ {{ state.fileName }} + {{ + { + done: "上传完成", + uploading: "正在上传", + error: "上传失败", + removed: "正在上传", + }[state.status] }} +
+ +
+
+ 导入 {{ state.totalNum }} 条,成功 {{ state.successNum }} 条,失败 {{ state.failNum + }} + 条。 +
+ + 下载失败数据 + +
+
+
+
+ + + + + + diff --git a/src/hooks/useDownload.js b/src/hooks/useDownload.js new file mode 100644 index 00000000..7bd04a3c --- /dev/null +++ b/src/hooks/useDownload.js @@ -0,0 +1,33 @@ +import http from "@/api/configSys"; +/** + * @param {String} url [请求的url地址] + * @param {Object} params [参数] + * @param {String} fileName [导出文件名称] 默认值 导出文件 + * @param {String} fileType [导出文件类型] 默认值 xls + * @param {string} mimeType [导出文件类型] + */ +const useDownload = (url, params = {}, fileName = '导出文件', fileType = 'xls', mimeType = 'application/vnd.ms-excel;charset=UTF-8') => { + return new Promise((resolve, reject) => { + http.post(url, params, { responseType: 'blob' }) + .then(res => { + resolve(res.data); + if (!res.data) { + return + } + const link = document.createElement('a');// 创建a标签 + let blob = new Blob([res.data], { type: mimeType }); // 设置文件类型 + link.style.display = "none"; + link.href = URL.createObjectURL(blob); // 创建URL + link.setAttribute("download", `${fileName}.${fileType}`); + document.body.appendChild(link); + link.click(); + URL.revokeObjectURL(link.href); + document.body.removeChild(link); + }) + .catch(err => { + reject(err.data); + }) + }); +} + +export default useDownload \ No newline at end of file diff --git a/src/views/case/CaseManage.vue b/src/views/case/CaseManage.vue index 58b58328..5521049a 100644 --- a/src/views/case/CaseManage.vue +++ b/src/views/case/CaseManage.vue @@ -17,7 +17,7 @@ frameborder="0" name="myframe" security="restricted" - sandbox="allow-forms allow-scripts allow-same-origin allow-popups" + sandbox="allow-forms allow-scripts allow-same-origin allow-popups allow-downloads" >
diff --git a/src/views/case/CaseRecommended.vue b/src/views/case/CaseRecommended.vue new file mode 100644 index 00000000..470b834c --- /dev/null +++ b/src/views/case/CaseRecommended.vue @@ -0,0 +1,779 @@ + + + + diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index ef20e00d..5c7e7752 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -2211,7 +2211,16 @@ export default defineComponent({ return text ? text : "-"; }, }, - + { + title: "关键字", + dataIndex: "tips", + key: "tips", + align: "left", + customCell :() => {return {style: {maxWidth: '200px',overflow: 'hidden',whiteSpace: 'nowrap',textOverflow:'ellipsis',cursor:'pointer'}}}, + customRender: ({ text }) => { + return {text ? text : "-"} + }, + }, { title: "内容分类", width: 130, @@ -3754,6 +3763,9 @@ export default defineComponent({ //编辑开课 const handelEditStu = async (item) => { + if (item.expenseStatus) { + return message.warning("该开课在审批中,不可进行编辑!"); + } state.offcourseId = item.offcourseId; state.itemType = item.type; state.offcoursePlanId = item.id; @@ -4256,6 +4268,9 @@ export default defineComponent({ delete_exit1(); }; const handleDeleteKaike = (value) => { + if (value.expenseStatus) { + return message.warning("该开课在审批中,不可进行删除!"); + } state.offcoursePlanId = value.id; state.delete_hs = true; diff --git a/src/views/courselibrary/components/seeModal.vue b/src/views/courselibrary/components/seeModal.vue index fb92a1b9..a6b4e1d0 100644 --- a/src/views/courselibrary/components/seeModal.vue +++ b/src/views/courselibrary/components/seeModal.vue @@ -199,7 +199,7 @@
- 内容标签: + 关键字:
{{ filterTxt(detail.tips) }} diff --git a/src/views/courselibrary/courseModal.vue b/src/views/courselibrary/courseModal.vue index 86338b5a..e30eb5d7 100644 --- a/src/views/courselibrary/courseModal.vue +++ b/src/views/courselibrary/courseModal.vue @@ -328,7 +328,7 @@
- 内容标签 + 关键字
@@ -339,7 +339,7 @@