From 553b2c9980e9c585826c4d664111963d94d55a9d Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 12 Jun 2024 10:08:38 +0800 Subject: [PATCH] fix: edu/train --- .env.development | 6 +- src/api/model/edu.js | 77 +++++++++- src/config/route.js | 20 +++ src/views/edu/exam.vue | 6 + src/views/edu/examrecord.vue | 120 ++++++++++++++++ src/views/edu/paper_form.vue | 65 ++++++++- src/views/edu/train.vue | 272 +++++++++++++++++++++++++++++++++++ 7 files changed, 560 insertions(+), 6 deletions(-) create mode 100644 src/views/edu/examrecord.vue create mode 100644 src/views/edu/train.vue diff --git a/.env.development b/.env.development index dcc90cca..cba0773b 100644 --- a/.env.development +++ b/.env.development @@ -16,8 +16,10 @@ VUE_APP_PJ = 'pf' # VUE_APP_API_BASEURL = http://127.0.0.1:2226/api #测试环境 -VUE_APP_API_BASEURL = http://49.232.14.174:2226/api -VUE_APP_BASEURL = http://49.232.14.174:2226 +# VUE_APP_API_BASEURL = http://49.232.14.174:2226/api +VUE_APP_API_BASEURL = http://127.0.0.1:2226/api +# VUE_APP_BASEURL = http://49.232.14.174:2226 +VUE_APP_BASEURL = http://127.0.0.1:2226 # #光子 # VUE_APP_API_BASEURL = http://49.232.14.174:2250/api diff --git a/src/api/model/edu.js b/src/api/model/edu.js index 2cfa7efa..b8249cab 100644 --- a/src/api/model/edu.js +++ b/src/api/model/edu.js @@ -118,7 +118,15 @@ export default { return await http.post( `${config.API_URL}/edu/paper/`, data); - } + }, + }, + upload: { + name:"上传试卷", + req: async function(data){ + return await http.post( + `${config.API_URL}/edu/paper/upload`, + data); + }, }, delete: { name: "删除", @@ -169,5 +177,70 @@ export default { `${config.API_URL}/edu/exam/${id}/`); } }, - } + }, + examrecord: { + list: { + name: "列表", + req: async function(data){ + return await http.get( + `${config.API_URL}/edu/examrecord/`, + data + ); + } + }, + item: { + name: "获取详情", + req: async function(id){ + return await http.get( + `${config.API_URL}/edu/examrecord/${id}/` + ); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/edu/examrecord/${id}/` + ); + } + } + }, + training: { + list: { + name: "列表", + req: async function(data){ + return await http.get( + `${config.API_URL}/edu/training/`, + data + ); + } + }, + create: { + name: "创建", + req: async function(data){ + return await http.post( + `${config.API_URL}/edu/training/`, + data + ); + } + }, + update: { + name: "更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/edu/training/${id}/`, + data + ); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/edu/training/${id}/` + ); + } + }, + + } } \ No newline at end of file diff --git a/src/config/route.js b/src/config/route.js index 2859527d..8f55184b 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -2422,6 +2422,26 @@ const routes = [ "perms": ["exam"] }, "component": "edu/exam" + }, + { + "name": "train", + "path": "/edu/train", + "meta": { + "title": "线下培训", + "icon": "el-icon-notebook", + "perms": ["train"] + }, + "component": "edu/train" + }, + { + "name": "examrecord", + "path": "/edu/examrecord", + "meta": { + "title": "考试记录", + "icon": "el-icon-notebook", + "perms": ["examrecord"] + }, + "component": "edu/examrecord" } ] }, diff --git a/src/views/edu/exam.vue b/src/views/edu/exam.vue index b34634f7..5de5f5e5 100644 --- a/src/views/edu/exam.vue +++ b/src/views/edu/exam.vue @@ -233,6 +233,12 @@ export default { this.examForm = Object.assign({}, row); this.examDialog = true; }, + row_detail(row) { + this.$router.push({ + path: "/edu/examrecord/", + query: { id: row.id }, + }); + }, table_del(row) { this.$API.edu.exam.delete.req(row.id).then(() => { this.handleQuery(); diff --git a/src/views/edu/examrecord.vue b/src/views/edu/examrecord.vue new file mode 100644 index 00000000..117f8329 --- /dev/null +++ b/src/views/edu/examrecord.vue @@ -0,0 +1,120 @@ + + diff --git a/src/views/edu/paper_form.vue b/src/views/edu/paper_form.vue index f3fd4800..28236285 100644 --- a/src/views/edu/paper_form.vue +++ b/src/views/edu/paper_form.vue @@ -157,6 +157,7 @@ 批量选择 + @@ -214,16 +215,51 @@ > + + + + + + + + + + + + + +
+ 取消 + 确认 +
+