diff --git a/src/api/index1.js b/src/api/index1.js index 6141767f..34e6f565 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -40,19 +40,11 @@ export const uploadFile = (obj) => http.post('/test/testRequest', qs.stringify({ // 接口-请求 //创建学习路径 -export const createLearnPath = (obj) => http.post('/admin/router/edit', obj, { - headers: { - 'token': '123' - } -}); +export const createLearnPath = (obj) => http.post('/admin/router/edit', obj); // 获取学习路径图列表 export const getLearnPath = (obj) => http.post('/admin/router/list', obj); //删除学习路径图 -export const deleteLearnPath = (obj) => http.post('/admin/router/handle', obj, { - headers: { - 'token': '123' - } -}); +export const deleteLearnPath = (obj) => http.post('/admin/router/handle', obj); //获取关卡 export const getChapter = (obj) => http.post('/admin/router/detail', { params: obj }); diff --git a/src/components/drawers/AddEval.vue b/src/components/drawers/AddEval.vue index ca8c6f5c..6c8c4f29 100644 --- a/src/components/drawers/AddEval.vue +++ b/src/components/drawers/AddEval.vue @@ -101,7 +101,7 @@ - - - \ No newline at end of file diff --git a/src/views/learningpath/LearningPath.vue b/src/views/learningpath/LearningPath.vue index 1b1867e2..f18a3419 100644 --- a/src/views/learningpath/LearningPath.vue +++ b/src/views/learningpath/LearningPath.vue @@ -4,25 +4,21 @@
-
- + + />
@@ -35,19 +31,20 @@ style="width: 270px" /> -->
-
搜索
+
搜索
-
重置
+
重置
@@ -613,28 +610,6 @@ export default { setup() { const router = useRouter(); const state = reactive({ - projectNameList: [ - { - id: 1, - value: "项目一", - label: "项目一", - }, - { - id: 2, - value: "项目二", - label: "项目二", - }, - { - id: 3, - value: "项目三", - label: "项目三", - }, - { - id: 4, - value: "项目四", - label: "项目四", - }, - ], out: false, out1: false, number: null, @@ -692,6 +667,8 @@ export default { value1: "", value2: "", + // + //创建、编辑------------------------- pathName: "", //创建/编辑路径图名称 organizationList: [ { @@ -722,6 +699,33 @@ export default { createLoading: false, //创建路径loading deletePathId: null, //删除路径id editPathId: null, //修改路径id + //搜索------------------------------ + pathnameSearch: null, //搜索路径名称 + statusList: [ + { + id: 1, + value: "草稿", + label: "草稿", + classify: 0, + }, + { + id: 2, + value: "已发布", + label: "已发布", + classify: 1, + }, + { + id: 3, + value: "已停用", + label: "已停用", + classify: -1, + }, + ], + statusValue: null, //状态 + statusClassify: null, //选择状态类型 + searchdate: null, //选择时间 + startTime: null, //开始时间 + endTime: null, //结束时间 }); const selectProjectName = (value, index) => { @@ -976,7 +980,6 @@ export default { @@ -1022,7 +1025,6 @@ export default { { - if (!state.pathName) return message.info("请输入路径图名称"); - // if (!state.organizationSelectName) return message.info("请选择归属组织"); + if (!state.pathName) return message.warning("请输入路径图名称"); + // if (!state.organizationSelectName) return message.warning("请选择归属组织"); // state.createLoading = true; let obj = { name: state.pathName, @@ -1197,6 +1197,10 @@ export default { let obj = { pageNo: state.currentPage, pageSize: state.pageSize, + name: state.pathnameSearch, + status: state.statusClassify, + beginTime: state.startTime, + endTime: state.endTime, }; api .getLearnPath(obj) @@ -1219,31 +1223,6 @@ export default { .catch((err) => { console.log("获取学习路径失败", err); }); - // let getChapterObj = { - // routerId: 0, - // }; - // api - // .getChapter(getChapterObj) - // .then((res) => { - // console.log("获取关卡数据", res); - // }) - // .catch((err) => { - // console.log("获取关卡数据失败", err); - // }); - - // let editChapterObj = { - // name: "测试关卡", - // remark: "这是测试关卡说明", - // routerId: 0, - // }; - // api - // .editChapter(editChapterObj) - // .then((res) => { - // console.log("添加测试关卡数据", res); - // }) - // .catch((err) => { - // console.log("添加测试关卡数据失败", err); - // }); }; //翻页 const changePagination = (page) => { @@ -1271,8 +1250,8 @@ export default { }; //编辑学习路径图 const editLearnPath = () => { - if (!state.pathName) return message.info("请输入路径图名称"); - // if (!state.organizationSelectName) return message.info("请选择归属组织"); + if (!state.pathName) return message.warning("请输入路径图名称"); + // if (!state.organizationSelectName) return message.warning("请选择归属组织"); // state.createLoading = true; let obj = { routerId: state.editPathId, @@ -1299,6 +1278,43 @@ export default { // state.createLoading = false; }); }; + //选择状态 + const selectStatusClassify = (e, v) => { + // console.log("eee", e, v); + state.statusValue = e; + state.statusClassify = v.classify; + }; + //修改时间 + const searchTimeChange = (e, date) => { + let startTime = date[0] + " 00:00:00"; + let endTime = date[1] + " 23:59:59"; + state.startTime = new Date(startTime).getTime() / 1000; + state.endTime = new Date(endTime).getTime() / 1000; + console.log("e", state.startTime, state.endTime); + }; + //搜索学习路径 + const searchLearnPath = () => { + state.currentPage = 1; + console.log( + "pathnameSearch", + state.pathnameSearch, + state.statusClassify, + state.startTime, + state.endTime + ); + getLearnPath(); + }; + //重置学习路径 + const resetLearnPath = () => { + state.currentPage = 1; + state.pathnameSearch = null; + state.statusValue = null; + state.statusClassify = null; + state.searchdate = null; + state.startTime = null; + state.endTime = null; + getLearnPath(); + }; onMounted(() => { // console.log("执行"); getLearnPath(); @@ -1333,6 +1349,10 @@ export default { changePagination, deleteLearnPath, editLearnPath, + selectStatusClassify, + searchTimeChange, + searchLearnPath, + resetLearnPath, }; }, }; @@ -1837,6 +1857,10 @@ export default { .filterItems { display: flex; flex-wrap: wrap; + .pathnameInp { + margin-right: 20px; + margin-bottom: 20px; + } .select { margin-right: 20px; margin-bottom: 20px; diff --git a/src/views/system/SystemManage.vue b/src/views/system/SystemManage.vue index 1dbb2ba0..9f5e3800 100644 --- a/src/views/system/SystemManage.vue +++ b/src/views/system/SystemManage.vue @@ -27,10 +27,12 @@ + +
+ 跳转 +