diff --git a/src/api/index.js b/src/api/index.js index 49ade8be..f1afd2ed 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -37,11 +37,8 @@ import http from "./config"; // 接口-请求 -// 创建编辑单层项目 +// 创建编辑单层项目(type=3)/ 多层项目(type=1)/ 多层子项目(type=2) export const createProject = (obj) => http.post('/admin/project/edit', obj) -// 创建多层项目 -export const createStoreyProject = (obj) => http.post('/admin/project/edit', obj) - // 获取项目列表 export const getProjectList = (obj) => http.post('/admin/project/list', obj) \ No newline at end of file diff --git a/src/api/indexDiscuss.js b/src/api/indexDiscuss.js index cc9863a9..5167f69c 100644 --- a/src/api/indexDiscuss.js +++ b/src/api/indexDiscuss.js @@ -10,4 +10,4 @@ export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', export const deleteDiscuss = (obj) => http.post('/discuss/deleteDiscuss', { params: obj }); //修改讨论接口 -export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', { params: obj }); \ No newline at end of file +export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', obj ); \ No newline at end of file diff --git a/src/api/indexEval.js b/src/api/indexEval.js index b02e4875..9967452d 100644 --- a/src/api/indexEval.js +++ b/src/api/indexEval.js @@ -1,5 +1,5 @@ import http from "./config"; -// import qs from 'qs'; +import qs from 'qs'; /** @@ -33,15 +33,19 @@ import http from "./config"; * axios.post(`${this.$url}/test/testRequest`,data).then() * */ - +// , { +// header: { +// 'token': '123', +// } +// } // 接口-请求 //创建测评 -export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj,); +export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj); //上传组件 -export const fileUp = (obj) => http.post('/file/upload', obj,); +export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj })); //删除测评信息 export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj }) diff --git a/src/api/indexExternalChain.js b/src/api/indexExternalChain.js index 9de46f42..653a5883 100644 --- a/src/api/indexExternalChain.js +++ b/src/api/indexExternalChain.js @@ -1,19 +1,39 @@ import http from "./config"; //创建外链接口 -export const createExternalChain = (obj) => http.post('/link/createLinks', obj) +export const createExternalChain = (obj) => http.post('/link/createLinks', obj, { + headers: { + 'token': '123' + } +}) //外链信息删除接口 -export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj }) +export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj }, { + headers: { + 'token': '123' + } +}) //获取外链详细信息接口 export const getLink = (obj) => http.post('/link/getOne', { params: obj }) // 更新外链数据 -export const updateLinks = (obj) => http.post('/link/updateLinks', obj) +export const updateLinks = (obj) => http.post('/link/updateLinks', obj, { + headers: { + 'token': '123' + } +}) //修改为必修的接口 -export const updateToCompulsory = (obj) => http.post('/link/updateToCompulsory', { params: obj }) +export const updateToCompulsory = (obj) => http.post('/link/updateToCompulsory', { params: obj }, { + headers: { + 'token': '123' + } +}) //修改为选修的接口 -export const updateToElective = (obj) => http.post('/link/updateToElective', { params: obj }) \ No newline at end of file +export const updateToElective = (obj) => http.post('/link/updateToElective', { params: obj }, { + headers: { + 'token': '123' + } +}) \ No newline at end of file diff --git a/src/api/indexLevel.js b/src/api/indexLevel.js index 39e22fcd..b7b1b400 100644 --- a/src/api/indexLevel.js +++ b/src/api/indexLevel.js @@ -1,8 +1,14 @@ import http from "./config"; -//新建或编辑关卡 +//新建关卡 export const editChapter = (obj) => http.post('/admin/router/editChapter', obj, { headers: { 'token': '123' } +}); +//编辑关卡 +export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj, { + headers: { + 'token': '123' + } }); \ No newline at end of file diff --git a/src/api/indexLiveBroadcast.js b/src/api/indexLiveBroadcast.js index ef05e98e..1f5bb7a6 100644 --- a/src/api/indexLiveBroadcast.js +++ b/src/api/indexLiveBroadcast.js @@ -4,10 +4,22 @@ import http from "./config"; export const getLiveBroadcastInfor = (obj) => http.get('/liveBroadcast', { params: obj }) //创建直播接口 -export const createLiveBroadcast = (obj) => http.post('/liveBroadcast/createLiveBroadcast', obj) +export const createLiveBroadcast = (obj) => http.post('/liveBroadcast/createLiveBroadcast', obj, { + headers: { + 'token': '123' + } +}) //直播信息删除接口 -export const deleteLiveBroadcast = (obj) => http.post('/liveBroadcast/deleteLiveBroadcast', obj) +export const deleteLiveBroadcast = (obj) => http.post('/liveBroadcast/deleteLiveBroadcast', obj, { + headers: { + 'token': '123' + } +}) //直播信息修改接口 -export const updateLiveBroadcastMessage = (obj) => http.post('/liveBroadcast/updateLiveBroadcastMessage', obj) \ No newline at end of file +export const updateLiveBroadcastMessage = (obj) => http.post('/liveBroadcast/updateLiveBroadcastMessage', obj, { + headers: { + 'token': '123' + } +}) \ No newline at end of file diff --git a/src/api/indexVote.js b/src/api/indexVote.js index e69de29b..ce450782 100644 --- a/src/api/indexVote.js +++ b/src/api/indexVote.js @@ -0,0 +1,75 @@ +import http from "./config"; +import qs from 'qs'; + + +/** + * 接口传参数方式(get) + * axios.get('/user', { + * params: { + * id: 12345, + * name: user + * } + * }).then(res => console.log(res)) + * + * 接口传参三种方式(post/put/patch) + * + * 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。 + * (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded') + * (request的Header:'Content-Type'= 'multipart/form-data') + * var formData=new FormData(); + * formData.append('user',123456);formData.append('pass',12345678); + * axios.post("/notice",formData).then() + * + * 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。 + * (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded') + * (request的Header:'Content-Type'= 'application/x-www-form-urlencoded') + * let data = {"code":"1234","name":"yyyy"}; + * axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then() + * + * 3.'Content-Type'= 'application/json,传参格式为 raw (JSON格式)。 + * (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded') + * (request的Header:'Content-Type'= 'application/json;charset=UTF-8') + * let data = {"code":"1234","name":"yyyy"} + * axios.post(`${this.$url}/test/testRequest`,data).then() + * + */ +// , { +// header: { +// 'token': '123', +// } +// } + +// 接口-请求 + +//基础票数上传接口 +// export const baseVoteupload = (obj) => http.post('/vote/baseVoteupload', obj) + +//创建题干信息接口 +export const createOptionMessage = (obj) => http.post('/vote/createOptionMessage', obj) + +//投票信息创建接口 +export const createVote = (obj) => http.post('/vote/createVote', obj) + +//删除投票信息 +export const deleteVoteMessage = (obj) => http.post('/vote/deleteVoteMessage', { params: obj }) + +//修改投票信息接口 +export const editVote = (obj) => http.post('/vote/editVote', obj) + +//根据题干ID获取题干信息 +export const queryStemByStemId = (obj) => http.post('/vote/queryStemByStemId', { params: obj }) + +//修改题干信息接口 +export const updateStemMessage = (obj) => http.post('/vote/updateStemMessage', obj); + +//上传组件 +export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj })); + + +// 测试方法 +// import * as api from '../../api/index' +// api.getLearnPath({}).then(res => { +// console.log(res) +// }).catch(err => { +// console.log(err) +// }) diff --git a/src/components/drawers/AddActive.vue b/src/components/drawers/AddActive.vue index 5388f71c..baceb73c 100644 --- a/src/components/drawers/AddActive.vue +++ b/src/components/drawers/AddActive.vue @@ -71,6 +71,12 @@
+
+ +
活动时间:
@@ -284,8 +290,9 @@ export default { //创建活动 const createActivity = () => { if(!state.inputV1) return message.warning("请输入活动名称"); - if(!state.inputV2) return message.warning("请输入活动时长"); if(!state.textV1) return message.warning("请输入活动公告"); + if(!state.time) return message.warning("请输入活动时间"); + if(!state.inputV2) return message.warning("请输入活动时长"); if(!state.inputV3) return message.warning("请输入活动地址"); let startTime = toDate(new Date(state.time[0].$d).getTime() / 1000, "Y-M-D"); let endTime = toDate(new Date(state.time[1].$d).getTime() / 1000, "Y-M-D"); diff --git a/src/components/drawers/AddEval.vue b/src/components/drawers/AddEval.vue index 16922bf3..61c9576c 100644 --- a/src/components/drawers/AddEval.vue +++ b/src/components/drawers/AddEval.vue @@ -120,8 +120,8 @@ export default { }, setup(props, ctx) { const state = reactive({ - inputV1: "", - inputV2: "", + inputV1: '', + inputV2: '', time: undefined, endTimes : "", startTimes: "", @@ -230,7 +230,7 @@ export default { evaluationEndTime: state.endTimes, evaluationFlag: "", evaluationId: "", - evaluationPictureAddress: state.picUrl, + evaluationPictureAddress: "", evaluationStartTime: state.startTimes, evaluationTag: "", evaluationTypeId: 0, diff --git a/src/components/drawers/CreVote.vue b/src/components/drawers/CreVote.vue index d3c43f77..4957fc70 100644 --- a/src/components/drawers/CreVote.vue +++ b/src/components/drawers/CreVote.vue @@ -18,70 +18,79 @@
- +
-
-
-
- +
+
+
+
+ +
+ 题干
- 题干: -
-
- -
-
-
-
-
- +
+
- 选项1:
-
- - + 上传图片 -
-
-
-
-
- +
+
+
+
+ +
+ {{ o.title }} +
+
+ + + 上传图片 + 删除 +
- 选项2:
-
- - + 上传图片 - 删除 -
-
-
-
-
-
添加选项
+
+
+
+
添加选项
+
- +
- + diff --git a/src/views/projectcenter/ProjectAdd.vue b/src/views/projectcenter/ProjectAdd.vue index 42af2981..f8c46024 100644 --- a/src/views/projectcenter/ProjectAdd.vue +++ b/src/views/projectcenter/ProjectAdd.vue @@ -81,12 +81,12 @@
项目经理
-
+
@@ -97,8 +97,13 @@
资源归属
-
- +
+
@@ -126,8 +131,13 @@
项目级别
-
- +
+
@@ -135,8 +145,13 @@
培训体系
-
- +
+
@@ -177,9 +192,14 @@
-
模板
+
模版
- +
@@ -340,13 +360,66 @@ export default { let manager = ""; let managerId = ""; const classificationChange1 = (key) => { - console.log(`selected ${key}`); - console.log(classifyList1.value[key - 1].label) - manager = String(classifyList1.value[key - 1].label) - managerId = String(key) + console.log(`selected ${key}`, classifyList1); + let mstr = ''; + let midstr = ''; + for (let i = 0; i < key.length; i++) { + if (key.length - 1 !== i) { + midstr += key[i] + ','; + mstr += classifyList1.value[i].label + ','; + } else { + midstr += key[i]; + mstr += classifyList1.value[i].label; + } + } + console.log(mstr, midstr) + manager = mstr; + managerId = midstr; }; // 资源归属 sourceBelongId 后续给接口 + const classifyList2 = ref([ + { value: 1, label: '项目一' }, + { value: 2, label: '项目二' }, + { value: 3, label: '项目三' }, + ]); + + const classificationChange2 = (key) => { + console.log(`selected ${key}`, classifyList2); + } + + // 项目级别 + const classifyList3 = ref([ + { value: 1, label: '集团级' }, + { value: 2, label: '组织级' }, + { value: 3, label: '现地级' }, + { value: 4, label: '部门级' }, + ]); + const classificationChange3 = (key) => { + console.log(`selected ${key}`, classifyList3); + } + + // 培训体系 + const classifyList4 = ref([ + { value: 1, label: '集团级' }, + { value: 2, label: '组织级' }, + { value: 3, label: '现地级' }, + { value: 4, label: '部门级' }, + ]); + const classificationChange4 = (key) => { + console.log(`selected ${key}`, classifyList4); + } + + // 模版 + const classifyList5 = ref([ + { value: 1, label: '模版一' }, + { value: 2, label: '模版二' }, + { value: 3, label: '模版三' }, + { value: 4, label: '模版四' }, + ]); + const classificationChange5 = (key) => { + console.log(`selected ${key}`, classifyList5); + } // 项目说明 const remark = ref(''); @@ -438,10 +511,14 @@ export default { api.createProject(obj).then(res => { console.log(res) if (res.status == 200 && res.data.code == 200) { - router.push({ - path: '/taskpage', - query: { id: res.data.data.projectId } - }); + message.destroy(); + message.success("创建成功") + setTimeout(() => { + router.push({ + path: '/taskpage', + query: { id: res.data.data.projectId } + }); + }, 1000); } else { message.destroy(); message.error("创建失败,请检查当前网络状态。") @@ -459,6 +536,10 @@ export default { classifyList, classificationChange, classificationChange1, + classificationChange2, + classificationChange3, + classificationChange4, + classificationChange5, fileList, fileList1, loading, @@ -469,6 +550,10 @@ export default { beforeUpload1, onRangeChange, classifyList1, + classifyList2, + classifyList3, + classifyList4, + classifyList5, remark, changeChecked, changeChecked1, diff --git a/src/views/projectcenter/ProjectManage.vue b/src/views/projectcenter/ProjectManage.vue index f0c34427..d827e774 100644 --- a/src/views/projectcenter/ProjectManage.vue +++ b/src/views/projectcenter/ProjectManage.vue @@ -1,91 +1,51 @@ diff --git a/src/views/projectcenter/SonProject.vue b/src/views/projectcenter/SonProject.vue index 0f5291e3..6174797b 100644 --- a/src/views/projectcenter/SonProject.vue +++ b/src/views/projectcenter/SonProject.vue @@ -1,528 +1,875 @@ + diff --git a/src/views/projectcenter/TaskAdd.vue b/src/views/projectcenter/TaskAdd.vue index f8ae648c..12ded11e 100644 --- a/src/views/projectcenter/TaskAdd.vue +++ b/src/views/projectcenter/TaskAdd.vue @@ -539,7 +539,9 @@ import AddVote from "../../components/drawers/AddVote.vue"; import { message } from "ant-design-vue"; import * as api from "../../api/indexTaskadd"; import * as apilive from "../../api/indexLiveBroadcast"; +import * as apiExternal from "../../api/indexExternalChain"; import * as apidiscuss from "../../api/indexDiscuss"; +import * as apiactivity from "../../api/indexActivity"; import * as apieval from "../../api/indexEval"; import * as apiinvist from "../../api/indexInvist"; const drawercolumns = [ @@ -673,6 +675,7 @@ export default { haspub: false, checked1: false, checkedd: false, + id: "ssss", }, { key: 2, @@ -857,9 +860,11 @@ export default { isactive: -1, isActive: false, deleteLiveID: null, //删除直播id + deleteExternalID: null, //删除外链id deleteEvalID: null, //测评 - deleteInvistID: null, //评估 + deleteInvistID: 4, //评估 deleteDiscussID: null, //删除讨论id + deleteActivityID: null, //删除活动id }); const selectProjectName = (value, index) => { console.log("value", value, index); @@ -968,13 +973,15 @@ export default { // width: 100, align: "center", scopedSlots: { customRender: "action" }, - customRender: () => { + customRender: (text) => { return (
{ state.editonlinevisible = true; + console.log(text, "编辑text"); + editInvistPath(); }} style="color:#4EA6FF;margin-right:25px;cursor:pointer" > @@ -984,8 +991,6 @@ export default { style="color:#4EA6FF;cursor:pointer" onClick={() => { showDelete(); - deleteEvalText(); - deleteInvistText(); }} > 删除 @@ -1008,7 +1013,7 @@ export default { .getTask(obj) .then((res) => { if (res.status == 200) { - console.log(res.data.data.stageList, 22222); + console.log("22222", res.data.data.stageList); } }) .catch((err) => { @@ -1032,7 +1037,25 @@ export default { console.log(err); }); }; - //删除讨论 + + //删除外链 + const deleteExternalChain = () => { + let obj = { + linkId: state.deleteExternalID, + // linkId: 11, + }; + apiExternal + .deleteLink(obj) + .then((res) => { + console.log(res); + //重新获取列表 + getTask(); + }) + .catch((err) => { + console.log(err); + }); + }; + const deleteDiscuss = () => { let obj = { discussId: state.deleteDiscussID, @@ -1050,10 +1073,85 @@ export default { console.log("删除失败", err); }); }; + //编辑讨论 + const editDiscuss = () => { + let obj = { + createTime: "", + createUser: 0, + discussExplain: "", + discussFlag: "", + discussId: 0, + discussName: "", + discussSettings: "", + discussTag: "", + projectId: 0, + updateTime: "", + updateUser: 0, + }; + apidiscuss + .updateDiscuss(obj) + .then((res) => { + console.log("更新成功", res); + message.success("更新成功"); + }) + .catch((err) => { + console.log("更新失败", err); + }); + }; + //删除活动 + const deleteActivity = () => { + let obj = { + activityId: state.deleteActivityID, + }; + apiactivity + .deleteActivity(obj) + .then((res) => { + console.log("删除成功", res); + message.success("删除成功"); + state.deleteModal = false; + //重新获取列表 + getTask(); + }) + .catch((err) => { + console.log("删除失败", err); + }); + }; + //编辑活动 + const editActivity = () => { + let obj = { + activityAddress: "", + activityDuration: "", + activityEndTime: "", + activityExplain: "", + activityFlag: "", + activityId: 0, + activityName: "", + activityNotice: "", + activityStartTime: "", + activityTag: "", + afterSignIn: "", + beforeSignIn: "", + createTime: "", + createUser: 0, + signOutTime: "", + standardSettings: "", + updateTime: "", + updateUser: 0, + }; + apiactivity + .updateActivity(obj) + .then((res) => { + console.log("更新成功", res); + message.success("更新成功"); + }) + .catch((err) => { + console.log("更新失败", err); + }); + }; //删除测评测试 const deleteEvalText = () => { let obj = { - evaluationId:state.deleteEvalID, + evaluationId: state.deleteEvalID, }; apieval .deleteEvaluationById(obj) @@ -1068,10 +1166,106 @@ export default { }); }; + //编辑测评信息 + const editEvalPath = () => { + let obj = { + createTime: "", + createUser: 0, + evaluationEndTime: "", + evaluationFlag: "", + evaluationId: "", + evaluationName: "", + evaluationPictureAddress: "", + evaluationStartTime: "", + evaluationTag: "", + evaluationTypeId: 0, + evaluationTypeName: "", + updateTime: "", + updateUser: 0, + }; + apieval + .updateEvaluation(obj) + .then((res) => { + setTimeout(() => { + console.log("修改成功", res); + message.success("修改成功"); + }, 1000); + }) + .catch((err) => { + console.log("修改失败", err); + // state.createLoading = false; + //重新获取列表 + getTask(); + }); + }; + + //编辑直播信息 + const editLiveBroadcast = () => { + let obj = { + afterSignIn: "", + beforeSignIn: "", + createTime: "", + createUser: 0, + liveCover: "", + liveDuration: 0, + liveEndTime: "", + liveExplain: "", + liveFlag: "", + liveId: 0, + liveLink: "", + liveName: "", + livePlayback: "", + livePlaybackLink: "", + liveStartTime: "", + liveTag: "", + liveTeacherId: 0, + otherSettings: "", + signOutTime: "", + standardSettings: "", + updateTime: "", + updateUser: 0, + }; + apilive + .updateLiveBroadcastMessage(obj) + .then((res) => { + console.log(res); + message.success("修改成功"); + }) + .catch((err) => { + console.log(err); + message.warn("修改失败"); + }); + }; + //编辑外链信息 + const editExternal = () => { + let obj = { + createTime: "", + createUser: 0, + linkAddress: "", + linkDescription: "", + linkFlag: "", + linkId: 0, + linkName: "", + linkTag: "", + updateTime: "", + updateUser: 0, + }; + apiExternal + .updateLinks(obj) + .then((res) => { + console.log(res); + message.success("修改成功"); + }) + .catch((err) => { + console.log(err); + message.warn("修改失败"); + }); + }; + //删除评估测试 const deleteInvistText = () => { let obj = { - evaluationId:state.deleteInvistID, + evaluationId: state.deleteInvistID, }; apiinvist .deleteAppraise(obj) @@ -1085,7 +1279,40 @@ export default { console.log("删除失败", err); }); }; - + + //编辑评估信息 + const editInvistPath = () => { + let obj = { + appraiseEndTime: "", + appraiseExplain: "", + appraiseFlag: "", + appraiseId: 0, + appraiseName: "", + appraiseStartTime: "", + appraiseTag: "", + createTime: "", + createUser: 0, + researchId: 0, + researchName: "", + updateTime: "", + updateUser: 0, + }; + apiinvist + .updateAppraiseMessage(obj) + .then((res) => { + setTimeout(() => { + console.log("修改成功", res); + message.success("修改成功"); + }, 1000); + }) + .catch((err) => { + console.log("修改失败", err); + // state.createLoading = false; + //重新获取列表 + getTask(); + }); + }; + const onSelectChange = (selectedRowKeys) => { console.log("selectedRowKeys changed: ", selectedRowKeys); state.selectedRowKeys = selectedRowKeys; @@ -1214,8 +1441,16 @@ export default { getTask, deleteLiveBroadcast, deleteDiscuss, + editDiscuss, deleteEvalText, + deleteExternalChain, + deleteActivity, + editActivity, + editEvalPath, deleteInvistText, + editLiveBroadcast, + editExternal, + editInvistPath, }; }, };