From b8c1e2f0ff875ef9688f6b3b3bea41bdbee6ed79 Mon Sep 17 00:00:00 2001 From: kclf <1195754634@qq.com> Date: Wed, 23 Nov 2022 22:52:56 +0800 Subject: [PATCH 1/7] t --- src/api/index1.js | 66 +++++++++++++++++++++++++---------------------- vue.config.js | 34 ++++++++++++------------ 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/src/api/index1.js b/src/api/index1.js index bc2d71bd..720203bd 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -7,8 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import http from "./config"; -import qs from 'qs'; - +import qs from "qs"; /** * 接口传参数方式(get) @@ -33,7 +32,7 @@ import qs from 'qs'; * (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') @@ -44,59 +43,65 @@ import qs from 'qs'; */ //上传文件 -export const uploadFile = (obj) => http.post('/test/testRequest', qs.stringify({ obj })); +export const uploadFile = (obj) => + http.post("/test/testRequest", qs.stringify({ obj })); // 接口-请求 //创建学习路径 -export const createLearnPath = (obj) => http.post('/admin/router/edit', obj); +export const createLearnPath = (obj) => http.post("/admin/router/edit", obj); // 获取学习路径图列表 -export const getLearnPath = (obj) => http.post('/admin/router/list', obj); +export const getLearnPath = (obj) => http.post("/admin/router/list", obj); //学习路径图的发布、停用、删除 -export const handleLearnPath = (obj) => http.post('/admin/router/handle', obj); +export const handleLearnPath = (obj) => http.post("/admin/router/handle", obj); //获取路径图统计数据 -export const getLearnCount = (routerId) => http.get('/admin/router/getCount', { params: { routerId: routerId } }) - +export const getLearnCount = (routerId) => + http.get("/admin/router/getCount", { params: { routerId: routerId } }); //新建或编辑关卡 -export const editChapter = (obj) => http.post('/admin/router/editChapter', obj); +export const editChapter = (obj) => http.post("/admin/router/editChapter", obj); // 编辑路径图设置 -export const setConfig = (obj) => http.post('/admin/router/setConfig', obj); +export const setConfig = (obj) => http.post("/admin/router/setConfig", obj); //获取学员列表 -export const getStudent = (obj) => http.post('/admin/router/studentList', obj); +export const getStudent = (obj) => http.post("/admin/router/studentList", obj); //获取路径图详情-包含关卡及任务列表 -export const getRouterDetail = (routerId) => http.get('/admin/router/detail', { - params: { - routerId: routerId, - } -}); +export const getRouterDetail = (routerId) => + http.get("/admin/router/detail", { + params: { + routerId: routerId, + }, + }); //添加学员 -export const addStudent = (obj) => http.post('/admin/router/addStudent', obj); +export const addStudent = (obj) => http.post("/admin/router/addStudent", obj); //删除学员 -export const delStudent = (obj) => http.post('/admin/router/deleteStudent', obj); +export const delStudent = (obj) => + http.post("/admin/router/deleteStudent", obj); // 获取学员路径图进度明细 -export const stuProgress = (obj) => http.post('/admin/router/studentProcess', obj); - +export const stuProgress = (obj) => + http.post("/admin/router/studentProcess", obj); //项目基础信息----------------------------------- //项目积分榜单 -export const scoreRank = (obj) => http.post('/admin/project/scoreRank', obj); +export const scoreRank = (obj) => http.post("/admin/project/scoreRank", obj); //排行榜 -export const billboard = (obj) => http.post('/admin/project/billboard', obj); +export const billboard = (obj) => http.post("/admin/project/billboard", obj); //项目基础信息----------------------------------- //获取字典信息 -export const getDict = (obj) => http.post('/dict/getList', obj) +export const getDict = (obj) => http.post("/dict/getList", obj); //获取组织树 -export const getOrgTree = (obj) => http.post('/admin/router/orgList', obj) - +export const getOrgTree = (obj) => http.post("/admin/router/orgList", obj); // 获取组织结构树 -export const orgtree = () => http.get('/org/tree'); - +export const orgtree = () => http.get("/org/tree"); //获取积分列表 -export const noticeList = (projectId) => http.post(`http://localhost:8080/api/admin/project/noticeList?projectId=` + projectId + ``) +export const noticeList = (projectId) => + http.post( + `http://localhost:8080/api/admin/project/noticeList?projectId=` + + projectId + + `` + ); // 测试方法 // import * as api from '../../api/index' @@ -106,5 +111,4 @@ export const noticeList = (projectId) => http.post(`http://localhost:8080/api/ad // console.log(err) // }) - -// export const choiceEvaluation = (obj) => http.post('/evaluation/choiceEvaluation', obj); \ No newline at end of file +// export const choiceEvaluation = (obj) => http.post('/evaluation/choiceEvaluation', obj); diff --git a/vue.config.js b/vue.config.js index b7ca1def..d825b217 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,21 +8,21 @@ */ const { defineConfig } = require("@vue/cli-service"); module.exports = defineConfig({ - publicPath: '/manage', - // transpileDependencies: true, - devServer: { - port: 8080, - proxy: { - "/manageApi": { - // target:"http://192.168.100.208:30001", - target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口 - changeOrigin: true, //表示是否改变原域名 - // secure: false, - // ws: false, //表示WebSocket协议 - pathRewrite: { - "^/manageApi": "", - }, - }, - }, - }, + publicPath: "/manage", + // transpileDependencies: true, + devServer: { + port: 8080, + proxy: { + "/manageApi": { + // target:"http://192.168.100.208:30001", + target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口 + changeOrigin: true, //表示是否改变原域名 + // secure: false, + // ws: false, //表示WebSocket协议 + pathRewrite: { + "^/manageApi": "", + }, + }, + }, + }, }); From cff9a26071febc7be1ec029b0e91ac348f009b55 Mon Sep 17 00:00:00 2001 From: Ggysh-7 <102372376+Ggysh-7@users.noreply.github.com> Date: Wed, 23 Nov 2022 23:07:03 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=E5=85=B3=E5=8D=A1=E5=92=8C=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=84=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=9C=89=E6=95=88token=EF=BC=8C=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E6=B7=BB=E5=8A=A0=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=81=8D=E5=8E=86?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/config.js | 2 +- src/components/drawers/AddCase.vue | 71 ++--- src/components/drawers/AddEval.vue | 147 +++++----- src/components/drawers/AddTest.vue | 2 +- src/components/drawers/EvList.vue | 19 +- src/components/drawers/SelectTest.vue | 26 +- src/components/drawers/TestManage.vue | 2 +- src/views/learningpath/LevelAddDetail.vue | 322 +++++++--------------- vue.config.js | 1 + 9 files changed, 221 insertions(+), 371 deletions(-) diff --git a/src/api/config.js b/src/api/config.js index e51593fd..a8899f02 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -32,7 +32,7 @@ http.interceptors.request.use( // 此处测试默认配置token config.headers.token = "123456"; - // config.headers.token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2Njg4NjI2MTAsImV4cCI6MTY2ODg2OTgxMCwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.defa91ecb2b61d9b20d858db0c2c8d7d80dea4613cb2559a22569b7df36b3f6b"; + // config.headers.token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NjkyMTE4MzMsImV4cCI6MTY2OTIxOTAzMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.40067eca3be5d50857448005a673cbe1a48f560ff8e9c7aea4e7ff12f59c7962"; } return config; }, diff --git a/src/components/drawers/AddCase.vue b/src/components/drawers/AddCase.vue index 22c806dc..a61dff5b 100644 --- a/src/components/drawers/AddCase.vue +++ b/src/components/drawers/AddCase.vue @@ -49,7 +49,7 @@ :row-class-name=" (_record, index) => (index % 2 === 1 ? 'table-striped' : null) " - :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" + :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :columns="tableDataFunc()" :data-source="tableData" :loading="tableDataTotal === -1 ? true : false" @@ -189,11 +189,8 @@ export default { } state.selectedRowKeys = selectedRowKeys; state.apiTaskList = selectedRows; + console.log('-------------%o-%o',state.apiTaskList, state.apiTaskList.length); }; - const onSelect = ( record ) => { - state.caseId = record.caseid; - state.caseName = record.title; - } const handelChangePage = (page, pageSize) => { state.currentPage = page; state.pageSize = pageSize; @@ -215,6 +212,7 @@ export default { array.push(obj); }); state.tableData = array; + console.log('get下来的数据',state.tableData); }; //获取全部案例信息接口 const getAllCaseText = () => { @@ -237,29 +235,32 @@ export default { }; const updateTask = () => { if (props.isLevel == 1) { - RouterEditTask({ - chapterId: props.isactive, - courseId: state.caseId, - name: state.caseName, - routerId: props.routerId, - routerTaskId: props.routerTaskId || 0, - type: 3, - }) - .then(() => { - message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); - ctx.emit("changeData", false); - closeDrawer(); - state.addLoading = false; + for(let i = 0;i < state.apiTaskList.length;i++){ + RouterEditTask({ + chapterId: props.isactive, + courseId: state.apiTaskList[i].caseid, + name: state.apiTaskList[i].caseName, + routerId: props.routerId, + routerTaskId: props.routerTaskId || 0, + type: 3, }) - .catch(() => { - message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`); - }); + .then(() => { + message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); + ctx.emit("changeData", false); + closeDrawer(); + state.addLoading = false; + }) + .catch(() => { + message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`); + }); + } } else if (props.isLevel == 2) { - if(state.apiTaskList.length > 1){ - for(let i = 0;i <= state.apiTaskList.length;i++){ + console.log("state api task list: %o-length: %o", state.apiTaskList, state.apiTaskList.length ) + for(let i = 0;i < state.apiTaskList.length;i++){ + console.log(state.apiTaskList[i],'state.apiTaskList[i].caseIdstate.apiTaskList[i].caseId'); apiTask .addTask({ - "courseId": state.apiTaskList[i].caseId, + "courseId": state.apiTaskList[i].caseid, "duration": 0, "flag": true, "name": state.apiTaskList[i].caseName, @@ -279,27 +280,6 @@ export default { message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); }); } - } else { - apiTask - .addTask({ - "courseId": state.caseId, - "duration": 0, - "flag": true, - "name": state.caseName, - "projectId": props.projectId, - "projectTaskId": props.projectTaskId, - "stageId": props.chooseStageId, - "type": 3, - }) - .then(() => { - message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`); - ctx.emit("changeData", false); - closeDrawer(); - }) - .catch(() => { - message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); - }); - } } else if (props.isLevel == 3) { console.log(""); } @@ -315,7 +295,6 @@ export default { closeDrawer, tableDataFunc, onSelectChange, - onSelect, handelChangePage, getTableDate, updateTask, diff --git a/src/components/drawers/AddEval.vue b/src/components/drawers/AddEval.vue index 2f3ece39..128063da 100644 --- a/src/components/drawers/AddEval.vue +++ b/src/components/drawers/AddEval.vue @@ -51,6 +51,14 @@ + + {{ evaluationTypeName }} +
@@ -88,11 +96,8 @@
- - @@ -161,106 +166,105 @@ export default { setup(props, ctx) { const state = reactive({ inputV1: "", - inputV2: "", time: undefined, EvalId: null, //子传回来的参数 - evaluationTypeId: null, + evaluationTypeId: 0, evaluationTypeName: "", description: "", EvalListVisible: false, // addLoading:false, }); - const checkFinish = (EvListDate)=> { - state.evaluationTypeId = EvListDate.Id - state.evaluationTypeName = EvListDate.Name + const checkFinish = (value)=> { + state.evaluationTypeId = value.quiz_kid + state.evaluationTypeName = value.title } const closeDrawer = () => { ctx.emit("update:addevalVisible", false); ctx.emit("update:edit", false); state.inputV1 = ""; - state.inputV2 = ""; localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("chapterId", props.isactive); }; const afterVisibleChange = (bool) => { if (props.edit && bool) { - queryEval(); + queryInvistById() } }; const showEvalDrawer = () => { state.EvalListVisible = true; }; - const queryEval = () => { - api - .queryEvaluationDetailById({ evaluationId: props.evaluationId }) - .then((res) => { - state.inputV1 = res.data.data.evaluationName; - state.time = [ - dayjs(res.data.data.evaluationStartTime, "YYYY-MM-DD"), - dayjs(res.data.data.evaluationEndTime, "YYYY-MM-DD"), - ]; - state.evaluationTypeId = res.data.data.evaluationTypeId; - state.evaluationTypeName = res.data.data.evaluationTypeName; - }) - .catch(() => { - }); - }; - const updateTask = (res) => { + const updateTask = (value) => { if (props.isLevel == 1) { - apitaskadd - .addTask({ - courseId: res.data.data.evaluationId, - name: res.data.data.evaluationName, - projectId: props.projectId, - projectTaskId: props.projectTaskId || 0, - stageId: props.chooseStageId, - evaluationTypeId: state.evaluationTypeId, - evaluationTypeName: state.evaluationTypeName, - type: 10, - }) - .then(( ) => { - message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); - }) - .catch(( ) => { - message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`); - }); - } else if (props.isLevel == 2) { RouterEditTask({ chapterId: props.isactive, - courseId: res.data.data.evaluationId, - name: res.data.data.evaluationName, + courseId: Number(value.evaluationId), + name: value.evaluationName, routerId: props.routerId, - routerTaskId: props.routerTaskId || 0, - evaluationTypeId: state.evaluationTypeId, - evaluationTypeName: state.evaluationTypeName, + routerTaskId: props.routerTaskId || 0, type: 10, }) .then(( ) => { - message.success(`${props.EditTestId ? "编辑" : "新增"}阶段任务成功`); + message.success(`${props.EditTestId ? "编辑" : "新增"}关卡任务成功`); }) .catch(( ) => { - message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`); + message.error(`${props.EditTestId ? "编辑" : "新增"}关卡任务失败`); + }); + } else if (props.isLevel == 2) { + apitaskadd + .addTask({ + duration: 0, + flag: true, + courseId: Number(value.evaluationId), + name: value.evaluationName, + projectId: props.projectId, + projectTaskId: props.projectTaskId || 0, + stageId: props.chooseStageId, + type: 10, + }) + .then(( ) => { + message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`); + }) + .catch(( ) => { + message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); }); } else if (props.isLevel == 3) { console.log(""); } }; - //创建或编辑测评信息 + //根据id获取测评信息 + const queryInvistById = ()=> { + let objqi = { + evaluationId : props.EditEvalId + } + api + .queryEvaluationDetailById(objqi) + .then((res) => { + message.destroy() + message.success("获取测评信息成功"); + state.inputV1 = res.data.data.evaluationName + state.evaluationTypeName = res.data.data.evaluationTypeName + state.evaluationTypeId = res.data.data.evaluationTypeId; + state.time = [ + dayjs(res.data.data.evaluationStartTime, "YYYY-MM-DD"), + dayjs(res.data.data.evaluationEndTime, "YYYY-MM-DD"), + ]; + }) + .catch(() => { + message.destroy() + message.error("获取测量平信息失败"); + }); + } + //创建测评信息 const createEvalText = () => { if (!state.inputV1) { message.destroy(); return message.info("请输入测评名称"); } - if (!state.inputV2) { + if (!state.evaluationTypeId) { message.destroy(); return message.info("请选择测评"); } - if (!state.time) { - message.destroy(); - return message.warning("请输入直播时间"); - } - let obj = { evaluationName: state.inputV1, evaluationEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), @@ -268,12 +272,15 @@ export default { evaluationStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"), evaluationTypeId: state.evaluationTypeId, evaluationTypeName: state.evaluationTypeName, + evaluationFlag: "", + evaluationPictureAddress: "", + evaluationTag: "", + updateTime: "", }; - if (props.edit !== true) { api .createEvaluation(obj) .then((res) => { - updateTask(res); + updateTask(res.data.data); message.success("创建成功"); closeDrawer(); ctx.emit("changeData", false); @@ -281,19 +288,6 @@ export default { .catch(() => { message.error("创建失败"); }); - } else { - api - .updateEvaluation(obj) - .then((res) => { - updateTask(res); - message.success("编辑成功"); - closeDrawer(); - ctx.emit("changeData", false); - }) - .catch(( ) => { - message.error("编辑失败"); - }); - } }; return { @@ -303,6 +297,7 @@ export default { closeDrawer, //增改 createEvalText, + queryInvistById, showEvalDrawer, updateTask, }; @@ -366,6 +361,10 @@ export default { margin-left: 15px; color: #fff; } + .tag-style { + color: rgb(113, 113, 237); + background-color: #d7d1f7; + } } } .main_item2 { diff --git a/src/components/drawers/AddTest.vue b/src/components/drawers/AddTest.vue index e16ef4d4..f3787e95 100644 --- a/src/components/drawers/AddTest.vue +++ b/src/components/drawers/AddTest.vue @@ -759,7 +759,7 @@ export default { }; const getData = (value)=> { state.paperId = value.paperId; - state.paperName = value.paperName; + state.paperName = value.testName; } return { formState, diff --git a/src/components/drawers/EvList.vue b/src/components/drawers/EvList.vue index 257dbd95..929bfa48 100644 --- a/src/components/drawers/EvList.vue +++ b/src/components/drawers/EvList.vue @@ -77,7 +77,7 @@ + diff --git a/src/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue index 338437fd..2d283673 100644 --- a/src/views/learningpath/LevelAddDetail.vue +++ b/src/views/learningpath/LevelAddDetail.vue @@ -486,6 +486,19 @@ />
项目
+
+ +
@@ -708,43 +721,8 @@ -
- -
-
-
关联项目
- -
-
- - -
-
- - -
-
-
-
+ +
@@ -1055,6 +1033,7 @@ import AddInvist from "../../components/drawers/AddInvist.vue"; import AddVote from "../../components/vote/AddVote.vue"; import AddLive from "../../components/drawers/AddLive.vue"; import AddRef from "../../components/drawers/AddRef.vue"; +import AddProject from "../../components/drawers/AddProject.vue"; import AddFaceteach from "../../components/drawers/AddFaceteach.vue"; import * as api from "../../api/indexLevel"; import { GetRouterDetail } from "../../api/indexTask"; @@ -1063,9 +1042,9 @@ import { storage } from "../../api/storage"; import { deleteStudyTask } from "../../api/indexStudy"; import draggable from "vuedraggable"; import { editTask } from "../../api/indexTaskadd"; -import * as apiProj from "../../api/index.js"; + import { RouterEditTask } from "@/api/indexTask"; -import dayjs from "dayjs"; + import { toDate } from "../../api/method"; import UnlockMode from "../../components/drawers/UnlockMode.vue"; export default { @@ -1087,6 +1066,7 @@ export default { draggable, UnlockMode, AddFaceteach, + AddProject, }, setup() { const state = reactive({ @@ -1267,7 +1247,7 @@ export default { EditVoteId: "", EditFaceId: "", //项目 - EditProjId: "", + EditProjectId: "", routerTaskId: "", chapterId: "", stageId: "", @@ -1485,7 +1465,7 @@ export default { //打开项目抽屉 const showDrawerAddProj = (id, eleId) => { state.addprojvisible = true; - state.EditActiveId = id; + state.EditProjectId = id; state.routerTaskId = eleId; }; //关闭项目抽屉 @@ -1557,11 +1537,7 @@ export default { message.error(err); }); }; - const afterProjVisibleChange = (bol) => { - if(bol == true){ - getAllProjText() - } - }; + const showAddStu = () => { state.AddSvisible = true; }; @@ -1947,69 +1923,7 @@ export default { console.log("阶段改变", value, option); state.removeStageId = option.chapterId; }; - //项目抽屉用的 - const onProjSelectChange = (selectedRowKeys,selectedRows) => { - state.selectedProjRowKeys = selectedRowKeys - // if(selectedRowKeys.length>1){ - // return - // } - state.projId = selectedRows[0].projectId - state.projName = selectedRows[0].name - console.log(state.projId,'------------------'); - // console.log(selectedRowKeys,selectedRows); - } - const getTableDate = (data) => { - let array = [] - data.map((value)=>{ - if(value.type == 3){ - let obj = { - key: value.projectId, - parentId:value.parentId, - projectId:value.projectId, - name: value.name, - manager:value.manager, - time: dayjs(value.createTime).format("YYYY-MM-DD"), - } - array.push(obj) - } - else { - let obj = { - key: value.projectId, - parentId:value.parentId, - name: value.name, - manager:value.manager, - time: dayjs(value.createTime).format("YYYY-MM-DD"), - children: value.subList ? getTableDate(value.subList) : [] , - } - array.push(obj) - } - }) - return array - }; - //获取全部项目信息接口 - const getAllProjText = () => { - apiProj - .getProjectList({ - "beginTime": 0, - "createName": "", - "endTime": "", - "manager": "", - "name": "", - "pageNo": 1, - "pageSize": 10, - "status": 0 - }) - .then((res) => { - let arr = res.data.data.rows; - if (res.status === 200) { - state.drawertableData = getTableDate(arr); - } - }) - .catch(() => { - message.destroy() - message.error("获取全部项目信息接口失败") - }); - }; + //添加关卡项目 const updateTask = () => { RouterEditTask({ @@ -2044,7 +1958,6 @@ export default { tableDataFunc2, showModal, closeModal, - afterProjVisibleChange, showAddStu, showImpStu, // drawercolumns, @@ -2084,9 +1997,7 @@ export default { showChangeModal, closeChangeModal, handleChangeStage, - onProjSelectChange, - getTableDate, - getAllProjText, + updateTask, showDeleteChapter, diff --git a/src/views/projectcenter/TemplateLibrary.vue b/src/views/projectcenter/TemplateLibrary.vue index e271b643..68654ef3 100644 --- a/src/views/projectcenter/TemplateLibrary.vue +++ b/src/views/projectcenter/TemplateLibrary.vue @@ -99,6 +99,9 @@ export default defineComponent({ const state = reactive({ value1: null, time:null, + currentPage: 1, + pageSize: 10, + total:0, tableData1: [ { key: "1", @@ -168,9 +171,9 @@ export default defineComponent({ state.tableData = data; }; const pagination = reactive({ - current: 1, - total: 50, - defaultPageSize: 10, + current: state.currentPage, + total: state.total, + defaultPageSize: state.pageSize, onChange: (id) => { pagination.current = id; getLibraryList() }, }) getTableDate1(); @@ -181,14 +184,12 @@ export default defineComponent({ // 获取模板列表 const getLibraryList = () => { - let date = Math.ceil(new Date(state.time).getTime() / 1000); - + let date = Math.ceil(new Date(state.time).getTime() / 1000); let obj = { - // "create_time": state.time, - "beginTime":date, + "createTime" : date==0?null:date, "name": state.value1, "pageNo": pagination.current, - "pageSize": 10, + "pageSize": state.pageSize, } api.templateList(obj).then((res) => { state.tableData1 = [] From 08a77174d975c305da3b73562e87c14d761e38a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=86=99=E4=B8=9C?= <2195178163@qq.com> Date: Thu, 24 Nov 2022 14:15:40 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E6=A8=A1=E6=9D=BF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=9B=9E=E4=BC=A0=EF=BC=8C=E9=98=B6=E6=AE=B5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=B7=E6=96=B0=EF=BC=8C=E9=98=B6=E6=AE=B5=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/indexTemplate.js | 3 +++ src/views/projectcenter/LibraryAdd.vue | 20 +++------------ src/views/projectcenter/TemplateLibrary.vue | 6 +++-- src/views/projectcenter/temTask.vue | 6 +++-- src/views/projectcenter/templateAdd.vue | 28 +++++++++++---------- 5 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/api/indexTemplate.js b/src/api/indexTemplate.js index be42523c..ef8b4745 100644 --- a/src/api/indexTemplate.js +++ b/src/api/indexTemplate.js @@ -19,3 +19,6 @@ export const editTask = (obj) => http.post('/admin/project/template/editTask',ob export const handleTemplates = (obj) => http.post('/admin/project/template/handle',obj); // 模板库列表 export const templateList = (obj) => http.post(`/admin/project/template/list`,obj); +// 发布项目公告 +export const publishNotice = (obj) => http.post(`/admin/project/template/publishNotice`,obj); + diff --git a/src/views/projectcenter/LibraryAdd.vue b/src/views/projectcenter/LibraryAdd.vue index 8f698d99..71bef498 100644 --- a/src/views/projectcenter/LibraryAdd.vue +++ b/src/views/projectcenter/LibraryAdd.vue @@ -33,7 +33,7 @@
-
返回
@@ -802,23 +802,9 @@ export default defineComponent({ // 发布公告 const addNotice = () => { let obj = { - "beginTime": 0, - "boeFlag": 0, - "category": 0, - "courseSyncFlag": 0, - "endTime": 0, - "level": 0, - "manager": "", - "managerId": "", - "name": "", "notice": state.projectInfo.notice, - "noticeFlag": 0, - "picUrl": "", - "projectTemplateId": store.state.projectTemplateId, - "remark": "", - "sourceBelongId": 0, - "status": 0, - "systemId": 0 + "projectId": store.state.projectTemplateId, + "title": "" }; api.templateEdit(obj).methods(obj).then(res => { message.success("公告发布成功") diff --git a/src/views/projectcenter/TemplateLibrary.vue b/src/views/projectcenter/TemplateLibrary.vue index 68654ef3..08e768c6 100644 --- a/src/views/projectcenter/TemplateLibrary.vue +++ b/src/views/projectcenter/TemplateLibrary.vue @@ -184,12 +184,14 @@ export default defineComponent({ // 获取模板列表 const getLibraryList = () => { - let date = Math.ceil(new Date(state.time).getTime() / 1000); + let date = Math.ceil(new Date(state.time).getTime() / 1000); + let obj = { + // "create_time": state.time, "createTime" : date==0?null:date, "name": state.value1, "pageNo": pagination.current, - "pageSize": state.pageSize, + "pageSize": state.pageSize } api.templateList(obj).then((res) => { state.tableData1 = [] diff --git a/src/views/projectcenter/temTask.vue b/src/views/projectcenter/temTask.vue index e334703e..79c83c22 100644 --- a/src/views/projectcenter/temTask.vue +++ b/src/views/projectcenter/temTask.vue @@ -1528,13 +1528,16 @@ let stageList = res.data.data.stageList; //阶段数组 let result = stageList.find((item) => item.templateStageId == stage); console.log("又找到了", result); + changebgc(res.data.data.stageList[0].templateStageId); getTableData(result.taskList); + } else { let arr = res.data.data.stageList[0].taskList; console.log("任务列表", arr); + changebgc(res.data.data.stageList[0].templateStageId); getTableData(arr); // state.isActive = true; - changebgc(res.data.data.stageList[0].templateStageId); + } // 每次都获取了第一条taskList @@ -1542,7 +1545,6 @@ // console.log("任务列表", stage, arr); // getTableData(arr); } - let stagearr = res.data.data.stageList; let arrlist = state.curLevel; console.log(stagearr, 111111); diff --git a/src/views/projectcenter/templateAdd.vue b/src/views/projectcenter/templateAdd.vue index faab4b1c..6ba7468f 100644 --- a/src/views/projectcenter/templateAdd.vue +++ b/src/views/projectcenter/templateAdd.vue @@ -47,7 +47,6 @@ } " v-model:value="projectInfo.category" - placeholder="管理者" style="width: 100%" :options="classifyList" @change="classificationChange" @@ -121,7 +120,8 @@
@@ -141,7 +141,8 @@ return triggerNode.parentNode || document.body; } " - :value="projectInfo.manager" + + :value="classifySelect1" mode="multiple" placeholder="请选择项目经理" style="width: 100%" @@ -319,6 +320,7 @@ import * as api from "../../api/indexTemplate"; import { storage } from "../../api/storage"; import {useStore} from "vuex"; // import { toDate } from "../../api/method"; +import dayjs from "dayjs"; export default { name: "projectAdd", @@ -358,7 +360,7 @@ export default { valueE: null, valueE1: null, valueE2: null, - classifySelect1: [], + classifySelect1: ['李俊国'], classifySelect2: [], classifySelect3: [], classifySelect4: [], @@ -370,16 +372,16 @@ export default { totalPages: 0, //总页数 viewDetail: routers.query.viewDetail ? routers.query.viewDetail : null, projectInfo:{ - beginTime:null, - endTime:null, + choosedTime:'', name: null, manager: null, notice: null, - sourceBelongId: null, + sourceBelongId: 1, + category:1, remark: "", courseSyncFlag: false, - level: null, - systemId: null, + level: 1, + systemId: 2, boeFlag: false, } }); @@ -468,7 +470,7 @@ export default { } if (info.file.status === "error") { loading.value = false; - message.error("upload error"); + message.error("upload error"); } }; @@ -628,9 +630,9 @@ export default { "name": state.projectInfo.name, "category": state.projectInfo.category, "picUrl": "x", - "beginTime": state.projectInfo.rangevalue || 1, - "endTime": state.projectInfo.rangevalue || 1, - "manager": state.projectInfo.manager, + "beginTime": Number(dayjs(state.projectInfo.choosedTime[0]).format("YYYY-MM-DD")) || 1, + "endTime": Number(dayjs(state.projectInfo.choosedTime[1]).format("YYYY-MM-DD")) || 1, + "manager": state.classifySelect1.toString(), "managerId": state.projectInfo.managerId || 0, "sourceBelongId": state.projectInfo.sourceBelongId, "level": state.projectInfo.level, From 646df5f2b59cb87243dbcfeb7e685c137c544a98 Mon Sep 17 00:00:00 2001 From: zhangyc Date: Thu, 24 Nov 2022 14:27:29 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/drawers/AddProject.vue | 317 ++++++++++++++++++-------- 1 file changed, 224 insertions(+), 93 deletions(-) diff --git a/src/components/drawers/AddProject.vue b/src/components/drawers/AddProject.vue index 8ee7b715..09741fb7 100644 --- a/src/components/drawers/AddProject.vue +++ b/src/components/drawers/AddProject.vue @@ -1,46 +1,97 @@