diff --git a/admin_prod.zip b/admin_prod.zip new file mode 100644 index 0000000..44ea6f3 Binary files /dev/null and b/admin_prod.zip differ diff --git a/admin_test.zip b/admin_test.zip new file mode 100644 index 0000000..7e3a6d4 Binary files /dev/null and b/admin_test.zip differ diff --git a/package.json b/package.json index 4897220..471d639 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "keysaas", "version": "3.4.0", - "description": "关键测试云平台", + "description": "小关软测宝后台管理", "author": "mihong", "license": "MIT", "scripts": { @@ -76,6 +76,7 @@ "vue-router": "3.4.9", "vuedraggable": "2.24.3", "vuex": "3.6.0", + "xlsx": "^0.18.5", "xss": "^1.0.15" }, "devDependencies": { diff --git a/src/api/trainService/index.js b/src/api/trainService/index.js index f832866..a76b1f2 100644 --- a/src/api/trainService/index.js +++ b/src/api/trainService/index.js @@ -1,328 +1,381 @@ -import request from '@/utils/request' +import request from "@/utils/request"; export function getSchoolList(query) { return request({ - url: '/train/schoolList', - method: 'get', + url: "/train/schoolList", + method: "get", params: query, // headers: { // isToken: false // }, - }) + }); } export function addSchool(data) { return request({ - url: '/train/school/add', - method: 'post', + url: "/train/school/add", + method: "post", data, - }) + }); } export function updateSchool(data) { return request({ - url: '/train/school/update', - method: 'post', + url: "/train/school/update", + method: "post", data, - }) + }); } export function delSchool(id) { return request({ url: `/train/school/del/?schoolId=${id}`, - method: 'delete', - }) + method: "delete", + }); } - export function getSignUpList(query) { return request({ url: `/train/trainClassList`, - method: 'get', + method: "get", params: query, - - }) + }); } export function addSignUp(data) { return request({ - url: '/train/trainClass/add', - method: 'post', + url: "/train/trainClass/add", + method: "post", data, - - }) + }); } export function updateSignUp(data) { return request({ - url: '/train/trainClass/update', - method: 'post', + url: "/train/trainClass/update", + method: "post", data, - - - }) + }); } export function delSignUp(id) { return request({ url: `/train/trainClass/del?trainClassId=${id}`, - method: 'delete', - - }) + method: "delete", + }); } // 查询已报名列表 export function searchNum(params) { return request({ url: `/train/trainStudentList`, - method: 'get', + method: "get", params, - }) + }); } - - // 人才库+教师 // 新增人才 export function listTalent(params) { return request({ - url: '/talent/admin/list', - method: 'get', - params - }) + url: "/talent/admin/list", + method: "get", + params, + }); } export function addTalent(data) { return request({ - url: '/talent/admin/add', - method: 'post', + url: "/talent/admin/add", + method: "post", data, - - }) + }); } // 修改人才 export function updateTalent(data) { return request({ - url: '/talent/admin/update', - method: 'post', + url: "/talent/admin/update", + method: "post", data, - - }) + }); } // 删除人才-删除教师 export function deleteTalent(id) { return request({ - url: '/talent/admin/' + id, - method: 'delete', - - }) + url: "/talent/admin/" + id, + method: "delete", + }); } // 查看人才-教师详情 export function detailTalent(id) { return request({ - url: '/talent/admin/' + id, - method: 'get', - - }) + url: "/talent/admin/" + id, + method: "get", + }); } export function listTeacher() { return request({ - url: '/talent/admin/teacherList', - method: 'get', - - }) + url: "/talent/admin/teacherList", + method: "get", + }); } // 新增教师 export function addTeacher(data) { return request({ - url: '/talent/admin/teacher/add', - method: 'post', + url: "/talent/admin/teacher/add", + method: "post", data, - - }) + }); } // 修改教师 export function updateTeacher(data) { return request({ - url: '/talent/admin/teacher/update', - method: 'post', + url: "/talent/admin/teacher/update", + method: "post", data, - - }) + }); } // 下载模板 export function importTemplate() { return request({ - url: '/talent/admin/download', - method: 'get', - responseType: 'blob', - - }) + url: "/talent/admin/download", + method: "get", + responseType: "blob", + }); } // 查询所有教师 export function listTeacherAll() { return request({ - url: '/talent/findAllTeacher', - method: 'get', - }) + url: "/talent/findAllTeacher", + method: "get", + }); } // 添加备注 export function addRemarkI(data) { return request({ - url: '/train/addRemark', - method: 'post', + url: "/train/addRemark", + method: "post", data, - }) + }); } // 删除报名人 export function delSign(id) { return request({ - url: '/train/trainStuden/del?studentId=' + id, - method: 'delete', - }) + url: "/train/trainStuden/del?studentId=" + id, + method: "delete", + }); } // 师资班配置json export function setJson(data) { return request({ - url: '/train/trainClass/editData', - method: 'post', + url: "/train/trainClass/editData", + method: "post", data, - }) + }); } // 导出excel -export function exportExcelF(id) { +export function exportExcelF(id, params) { return request({ - url: '/train/importStudent/' + id, - method: 'get', - responseType: 'blob', - }) + url: "/train/importStudent/" + id, + method: "get", + params, + responseType: "blob", + }); } - // 获取所有轮播图 export function getSwiperInfo() { return request({ - url: '/train/admin/banner/list', - method: 'get', - }) + url: "/train/admin/banner/list", + method: "get", + }); } // 提交轮播图 export function addSwiperInfo(data) { return request({ - url: 'train/admin/banner/add', - method: 'post', - data - }) + url: "train/admin/banner/add", + method: "post", + data, + }); } // 获取轮播图班级类型 export function getSwiperClass() { return request({ - url: '/train/admin/bannerTrainClasses', - method: 'get', - }) + url: "/train/admin/bannerTrainClasses", + method: "get", + }); } // 删除轮播图 export function delteSwiper(id) { console.log(id); return request({ - url: '/train/admin/banner/' + id, - method: 'delete', - }) + url: "/train/admin/banner/" + id, + method: "delete", + }); } // 获取所有班级 -export function getClassList() { +export function getClassList(params) { return request({ - url: '/train/admin/trainClasses', - method: 'get', - }) + url: "/train/admin/trainClasses", + method: "get", + params, + }); } // 获取所有课程 export function getCourseList(params) { return request({ - url: '/course/admin/findAll', - method: 'get', - params - }) + url: "/course/admin/findAll", + method: "get", + params, + }); } // 增加课程 export function addCourseItem(data) { return request({ - url: '/course/admin/add', - method: 'post', - data:JSON.stringify(data) - }) + url: "/course/admin/add", + method: "post", + data: JSON.stringify(data), + }); } // 修改课程 export function putCourseItem(data) { return request({ - url: '/course/admin/update', - method: 'post', - data - }) + url: "/course/admin/update", + method: "post", + data, + }); } // 删除课程 export function delCourse(id) { return request({ - url: '/course/admin/' + id, - method: 'delete', - }) + url: "/course/admin/" + id, + method: "delete", + }); } // 根据课程ID获取改课程下所有签到用户信息 -export function getSigninInfo(id,params) { +export function getSigninInfo(id, params) { return request({ - url: '/course/admin/singin/' + id, - method: 'get', - params - }) + url: "/course/admin/singin/" + id, + method: "get", + params, + }); } // 删除签到信息 export function delSigninItem(id) { return request({ - url: '/course/admin/singin/' + id, - method: 'delete', - }) + url: "/course/admin/singin/" + id, + method: "delete", + }); } // 考勤删除 export function delAttendance(id) { return request({ - url: '/course/admin/singin/class/' + id, - method: 'delete', - }) + url: "/course/admin/singin/class/" + id, + method: "delete", + }); } // 获取考勤信息表 export function getAttendanceList(id) { return request({ - url: '/course/admin/singin/class/' + id, - method: 'get', - }) + url: "/course/admin/singin/class/" + id, + method: "get", + }); } // 导出考勤表 export function exportAttendance(id) { return request({ - url: '/course/admin/importSignIn/class/' + id, - method: 'get', - responseType: 'blob' - }) + url: "/course/admin/importSignIn/class/" + id, + method: "get", + responseType: "blob", + }); } // 导出所有签到信息 -export function exportSignIn(id,params) { - console.log(params); +export function exportSignIn(id, params) { + return request({ + url: "/course/admin/importSignIn/course/" + id, + method: "get", + params, + responseType: "blob", + }); +} + +// 获取收入管理信息 +export function getInComeInfo(data) { + return request({ + url: "/mpay/admin/record/course/payList", + method: "post", + data, + }); +} +// 获取学习人次 +export function getStudyRows(id, params) { + console.log(id); + return request({ + url: "train/online/course/studyList/" + id, + method: "get", + params, + }); +} + +// 添加学生评价 +export function addStuentEva(data) { + return request({ + url: "train/admin/assessmen/add", + method: "post", + data, + }); +} +// 删除学生评价 +export function delStudentEva(id) { return request({ - url: '/course/admin/importSignIn/course/' + id, - method: 'get', + url: "train/admin/assessmen/" + id, + method: "delete", + }); +} +// 获取学生评价列表 +export function getStudentEva(id, params) { + console.log(id); + return request({ + url: "train/admin/assessmen/list/" + id, + method: "get", params, - responseType: 'blob' - }) -} \ No newline at end of file + }); +} + +// 导出评价信息 +export function exportEva(data) { + return request({ + url: "/train/admin/import/assement", + method: "post", + data, + responseType: "blob", + }); +} +// 复制班级 +export function copyClassInfo(id, nid) { + return request({ + url: "/course/admin/class/copy/" + id + "/" + nid, + method: "get", + }); +} + +// 导出学习人次 +export function expLearnNum(courseId) { + return request({ + url: "/train/admin/import/studyList/" + courseId, + method: "get", + responseType: "blob", + }); +} diff --git a/src/components/buttonUpload/index.vue b/src/components/buttonUpload/index.vue new file mode 100644 index 0000000..7681637 --- /dev/null +++ b/src/components/buttonUpload/index.vue @@ -0,0 +1,81 @@ + + + + + \ No newline at end of file diff --git a/src/components/formatForm/drective.js b/src/components/formatForm/drective.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/formatForm/formOptions.vue b/src/components/formatForm/formOptions.vue new file mode 100644 index 0000000..2cae51e --- /dev/null +++ b/src/components/formatForm/formOptions.vue @@ -0,0 +1,38 @@ + + + + + \ No newline at end of file diff --git a/src/components/formatForm/formResult.vue b/src/components/formatForm/formResult.vue new file mode 100644 index 0000000..6619193 --- /dev/null +++ b/src/components/formatForm/formResult.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/components/formatForm/formSource.vue b/src/components/formatForm/formSource.vue new file mode 100644 index 0000000..45545f4 --- /dev/null +++ b/src/components/formatForm/formSource.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/src/components/formatForm/index.vue b/src/components/formatForm/index.vue new file mode 100644 index 0000000..8070913 --- /dev/null +++ b/src/components/formatForm/index.vue @@ -0,0 +1,78 @@ + + + \ No newline at end of file diff --git a/src/components/formatForm/indexX.vue b/src/components/formatForm/indexX.vue new file mode 100644 index 0000000..da98e90 --- /dev/null +++ b/src/components/formatForm/indexX.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src/components/formatForm/parseFrom.js b/src/components/formatForm/parseFrom.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/formatForm/style.scss b/src/components/formatForm/style.scss new file mode 100644 index 0000000..3cea0f5 --- /dev/null +++ b/src/components/formatForm/style.scss @@ -0,0 +1,6 @@ +.form-wrap{ + background-color: antiquewhite; + .form-item{ + background-color: aqua; + } +} \ No newline at end of file diff --git a/src/components/formatForm/template.js b/src/components/formatForm/template.js new file mode 100644 index 0000000..28f6d51 --- /dev/null +++ b/src/components/formatForm/template.js @@ -0,0 +1,80 @@ +export const lableWidth = "80px"; + +const propertyMap = { + // title: "label", + type: "tag", + key: "formKey", + value: "defaultValue", +}; + +const fomrmSourceList = [ + { + type:'input', + tag:'input', + label:'输入框', + data:{defalut:'请输入文本'} + }, + { + type:'radio', + label:'单选框', + tag:'input', + data:{defalut:['test1','test2']} + }, + { + type:'checkBox', + tag:'input', + label:'多选框', + data:{defalut:['boxTest1','boxTest2','boxTest3']} + }, + { + type:'select', + tag:'select', + label:'下拉框', + data:{defalut:['seTest1','seTest2','seTest3']} + }, + { + tag:'textarea', + type:'textarea', + label:'文本框', + data:{defalut:'请输入文本'} + }, +]; + +const optionsTemplate = fomrmSourceList + +const formatForm = []; + +const itemTemp = { + tag: "", + property: {}, + text: "", + children: [], +}; +const formItemTemp = { + tag: "div", + property: { + class: "el-form-item", + }, + text: "", + children: [], +}; +const formTemplate = { + tag: "div", + property: { + ref: "forMatform", + class: "form-wrap", + ":model": `${formatForm}`, + "label-width": `${lableWidth}`, + }, + text: "", + children: [], +}; +export { + itemTemp, + formItemTemp, + formTemplate, + propertyMap, + formatForm, + fomrmSourceList, + optionsTemplate +}; diff --git a/src/components/formatForm/testData.js b/src/components/formatForm/testData.js new file mode 100644 index 0000000..5438f20 --- /dev/null +++ b/src/components/formatForm/testData.js @@ -0,0 +1,42 @@ +export const testData = [ + { name: "姓名", type: "input", key: "name", value: "" }, + { title: "在校职务", type: "input", key: "title", value: "" }, + { mobile: "手机号", type: "input", key: "mobile", value: "" }, + { college: "院校全称", type: "input", key: "college", value: "" }, + { address: "院校所在地址", type: "input", key: "address", value: "" }, + { + payType: "培训付款方式", + type: "radio", + key: "payType", + value: [ + "公对公转账,请于报到前提供截图", + "现场支付(公务卡、微信、支付宝、现金)", + ], + }, + { sex: "性别", type: "radio", key: "sex", value: ["男", "女"] }, + { + hotel: "是否需要统一安排住宿", + type: "radio", + key: "hotel", + value: [ + "大床房(付房费全额)", + "标间(独立居住、付全额房费)", + "标间(拼房、付房费一半),无指定合住人员", + "标间(拼房、付房费一半),指定合住人员", + "其他,请说明,包括非指定日期的订房", + "无须订房,自行安排", + ], + }, + { + addWeixin: "是否添加业务负责人微信", + type: "radio", + key: "addWeixin", + value: ["是", "否"], + }, + { + suggestion: "针对此次培训,您还有什么建议", + type: "textarea", + key: "suggestion", + value: "", + }, +]; diff --git a/src/components/importCourse/index.vue b/src/components/importCourse/index.vue new file mode 100644 index 0000000..3755485 --- /dev/null +++ b/src/components/importCourse/index.vue @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index 3a5e589..d74d65d 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -35,7 +35,7 @@ export default { }, data() { return { - title: '关键测试云平台', + title: '小关软测宝后台管理', logo: null } } diff --git a/src/router/index.js b/src/router/index.js index 6563454..416da30 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,11 +1,11 @@ -import Vue from 'vue' -import Router from 'vue-router' +import Vue from "vue"; +import Router from "vue-router"; -Vue.use(Router) +Vue.use(Router); /* Layout */ -import Layout from '@/layout' -import ParentView from '@/components/ParentView'; +import Layout from "@/layout"; +import ParentView from "@/components/ParentView"; /** * Note: 路由配置项 @@ -28,264 +28,317 @@ import ParentView from '@/components/ParentView'; // 公共路由 export const constantRoutes = [ { - path: '/redirect', + path: "/redirect", component: Layout, hidden: true, children: [ { - path: '/redirect/:path(.*)', - component: (resolve) => require(['@/views/redirect'], resolve) - } - ] + path: "/redirect/:path(.*)", + component: (resolve) => require(["@/views/redirect"], resolve), + }, + ], }, { - path: '/login', - component: (resolve) => require(['@/views/tester_login'], resolve), - hidden: true + path: "/login", + component: (resolve) => require(["@/views/tester_login"], resolve), + hidden: true, }, { - path: '/register', - component: (resolve) => require(['@/views/register'], resolve), - hidden: true + path: "/register", + component: (resolve) => require(["@/views/register"], resolve), + hidden: true, }, { - path: '/retrieve', - component: (resolve) => require(['@/views/retrieve'], resolve), - hidden: true + path: "/retrieve", + component: (resolve) => require(["@/views/retrieve"], resolve), + hidden: true, }, { - path: '/tl', - component: (resolve) => require(['@/views/tester_login'], resolve), - hidden: true + path: "/tl", + component: (resolve) => require(["@/views/tester_login"], resolve), + hidden: true, }, { - path: '/404', - component: (resolve) => require(['@/views/error/404'], resolve), - hidden: true + path: "/404", + component: (resolve) => require(["@/views/error/404"], resolve), + hidden: true, }, { - path: '/401', - component: (resolve) => require(['@/views/error/401'], resolve), - hidden: true + path: "/401", + component: (resolve) => require(["@/views/error/401"], resolve), + hidden: true, }, { - path: '', + path: "", component: Layout, - redirect: 'index', + redirect: "index", children: [ { - path: 'index', - component: (resolve) => require(['@/views/index'], resolve), - name: '首页', - meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } - } - ] + path: "index", + component: (resolve) => require(["@/views/index"], resolve), + name: "首页", + meta: { title: "首页", icon: "dashboard", noCache: true, affix: true }, + }, + ], }, { - path: '/user', + path: "/user", component: Layout, hidden: true, - redirect: 'noredirect', + redirect: "noredirect", children: [ { - path: 'profile', - component: (resolve) => require(['@/views/system/user/profile/index'], resolve), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } + path: "profile", + component: (resolve) => + require(["@/views/system/user/profile/index"], resolve), + name: "Profile", + meta: { title: "个人中心", icon: "user" }, + }, + { + path: "profile/:activeTab", + component: (resolve) => + require(["@/views/system/user/profile/index"], resolve), + name: "Profile", + meta: { title: "个人中心", icon: "user" }, }, { - path: 'profile/:activeTab', - component: (resolve) => require(['@/views/system/user/profile/index'], resolve), - name: 'Profile', - meta: { title: '个人中心', icon: 'user' } + path: "company", + component: (resolve) => + require(["@/views/system/user/company/index"], resolve), + name: "company", + meta: { title: "企业认证", icon: "user" }, }, { - path: 'company', - component: (resolve) => require(['@/views/system/user/company/index'], resolve), - name: 'company', - meta: { title: '企业认证', icon: 'user' } + path: "p2pt", + component: (resolve) => + require(["@/views/system/user/tester/p2pt"], resolve), + name: "tester", + meta: { title: "测试资质认证", icon: "user" }, }, { - path: 'p2pt', - component: (resolve) => require(['@/views/system/user/tester/p2pt'], resolve), - name: 'tester', - meta: { title: '测试资质认证', icon: 'user' } + path: "p2ct", + component: (resolve) => + require(["@/views/system/user/tester/p2ct"], resolve), + name: "tester", + meta: { title: "测试资质认证", icon: "user" }, }, { - path: 'p2ct', - component: (resolve) => require(['@/views/system/user/tester/p2ct'], resolve), - name: 'tester', - meta: { title: '测试资质认证', icon: 'user' } + path: "c2ct", + component: (resolve) => + require(["@/views/system/user/tester/c2ct"], resolve), + name: "tester", + meta: { title: "测试资质认证", icon: "user" }, }, { - path: 'c2ct', - component: (resolve) => require(['@/views/system/user/tester/c2ct'], resolve), - name: 'tester', - meta: { title: '测试资质认证', icon: 'user' } + path: "message", + component: (resolve) => require(["@/views/my/message"], resolve), + name: "MyMessage", + meta: { title: "我的消息", icon: "user" }, }, + ], + }, + { + path: "/dict", + component: Layout, + hidden: true, + children: [ + { + path: "type/data/:dictId(\\d+)", + component: (resolve) => require(["@/views/system/dict/data"], resolve), + name: "Data", + meta: { title: "字典数据", icon: "" }, + }, + ], + }, + { + path: "/course", + component: Layout, + hidden: true, + children: [ { - path: 'message', - component: (resolve) => require(['@/views/my/message'], resolve), - name: 'MyMessage', - meta: { title: '我的消息', icon: 'user' } - } - ] + path: "learnNum", + component: (resolve) => + require(["@/views/trainService/learnStudent"], resolve), + name: "signupStudent", + meta: { title: "学习人次", icon: "" }, + }, + ], }, { - path: '/dict', + path: "/course", component: Layout, hidden: true, children: [ { - path: 'type/data/:dictId(\\d+)', - component: (resolve) => require(['@/views/system/dict/data'], resolve), - name: 'Data', - meta: { title: '字典数据', icon: '' } - } - ] + path: "courseImport", + component: (resolve) => + require(["@/views/trainService/importCourse"], resolve), + name: "importCourse", + meta: { title: "课程导入", icon: "" }, + }, + ], }, { - path: '/my', + path: "/my", component: Layout, hidden: true, children: [ { - path: 'tool/detail/:id(\\d+)', - component: (resolve) => require(['@/views/mytools/detail'], resolve), - name: 'myToolDetail', - meta: { title: '我的工具详情', icon: '' } - } - ] + path: "tool/detail/:id(\\d+)", + component: (resolve) => require(["@/views/mytools/detail"], resolve), + name: "myToolDetail", + meta: { title: "我的工具详情", icon: "" }, + }, + ], }, { - path: '/test', + path: "/test", component: Layout, hidden: true, children: [ { - path: 'tool/detail/:id(\\d+)', - component: (resolve) => require(['@/views/market/detail'], resolve), - name: 'MarketDetail', - meta: { title: '测试工具详情', icon: '' } - } - ] + path: "tool/detail/:id(\\d+)", + component: (resolve) => require(["@/views/market/detail"], resolve), + name: "MarketDetail", + meta: { title: "测试工具详情", icon: "" }, + }, + ], }, { - path: '/crowdsource', + path: "/crowdsource", component: Layout, hidden: true, children: [ { - path: 'my/publishApply/:id(\\d+)', - component: (resolve) => require(['@/views/crowdsource/my/publishApply/detail'], resolve), - name: 'crowdsourceAuditDetail', - meta: { title: '我发布的众包审核历史', icon: '' } + path: "my/publishApply/:id(\\d+)", + component: (resolve) => + require(["@/views/crowdsource/my/publishApply/detail"], resolve), + name: "crowdsourceAuditDetail", + meta: { title: "我发布的众包审核历史", icon: "" }, }, { - path: 'my/publish/:id(\\d+)', - component: (resolve) => require(['@/views/crowdsource/my/publish/detail'], resolve), - name: 'crowdsourcePublishDetail', - meta: { title: '我发布的众包任务详情', icon: '' } + path: "my/publish/:id(\\d+)", + component: (resolve) => + require(["@/views/crowdsource/my/publish/detail"], resolve), + name: "crowdsourcePublishDetail", + meta: { title: "我发布的众包任务详情", icon: "" }, }, { - path: 'my/claim/:id(\\d+)', - component: (resolve) => require(['@/views/crowdsource/my/claim/detail'], resolve), - name: 'crowdsourceClaimDetail', - meta: { title: '我应征的众包任务详情', icon: '' } + path: "my/claim/:id(\\d+)", + component: (resolve) => + require(["@/views/crowdsource/my/claim/detail"], resolve), + name: "crowdsourceClaimDetail", + meta: { title: "我应征的众包任务详情", icon: "" }, }, { - path: 'detail/:id(\\d+)', - component: (resolve) => require(['@/views/crowdsource/detail'], resolve), - name: 'myCrowdsourceDetail', - meta: { title: '众包任务详情', icon: '' } + path: "detail/:id(\\d+)", + component: (resolve) => + require(["@/views/crowdsource/detail"], resolve), + name: "myCrowdsourceDetail", + meta: { title: "众包任务详情", icon: "" }, }, { - path: 'manage/detail/:id(\\d+)', - component: (resolve) => require(['@/views/manage/crowdsource/detail'], resolve), - name: 'manageDetail', - meta: { title: '众包任务详情', icon: '' } - } - ] + path: "manage/detail/:id(\\d+)", + component: (resolve) => + require(["@/views/manage/crowdsource/detail"], resolve), + name: "manageDetail", + meta: { title: "众包任务详情", icon: "" }, + }, + ], }, { - path: '/buy', + path: "/buy", component: Layout, hidden: true, children: [ { - path: 'alipay', - component: (resolve) => require(['@/views/market/buy/alipay'], resolve), - name: 'alipay', - meta: { title: '支付宝支付', icon: '' } - } - ] + path: "alipay", + component: (resolve) => require(["@/views/market/buy/alipay"], resolve), + name: "alipay", + meta: { title: "支付宝支付", icon: "" }, + }, + ], }, { - path: '/callback', + path: "/callback", component: Layout, hidden: true, children: [ { - path: '', - component: (resolve) => require(['@/views/market/buy/return'], resolve), - name: 'return', - meta: { title: '支付结果', icon: '' } - } - ] + path: "", + component: (resolve) => require(["@/views/market/buy/return"], resolve), + name: "return", + meta: { title: "支付结果", icon: "" }, + }, + ], }, { - path: '/buy', + path: "/buy", component: Layout, hidden: true, children: [ { - path: 'tool/:id(\\d+)', - component: (resolve) => require(['@/views/market/buy/alipay'], resolve), - name: 'buyTool', - meta: { title: '购买工具', icon: '' } - } - ] + path: "tool/:id(\\d+)", + component: (resolve) => require(["@/views/market/buy/alipay"], resolve), + name: "buyTool", + meta: { title: "购买工具", icon: "" }, + }, + ], }, - + // { // path: '/signInInfoList', // component: (resolve) => require(['@/views/trainService/courseManageCom/signInInfoList.vue'], resolve), // name: 'signInList', // meta: { title: '签到详情', icon: '' } - + // }, { - path: '/job', + path: "/job", component: Layout, hidden: true, children: [ { - path: 'log', - component: (resolve) => require(['@/views/monitor/job/log'], resolve), - name: 'JobLog', - meta: { title: '调度日志' } - } - ] + path: "log", + component: (resolve) => require(["@/views/monitor/job/log"], resolve), + name: "JobLog", + meta: { title: "调度日志" }, + }, + ], + }, + { + path: "/testModule", + component: Layout, + hidden: true, + component: (resolve) => require(["@/views/testModule"], resolve), + meta: { title: "测试模块" }, + // children: [ + // { + // path: 'testModule', + // name: 'testModule', + // } + // ] }, { - path: '/gen', + path: "/gen", component: Layout, hidden: true, children: [ { - path: 'edit/:tableId(\\d+)', - component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), - name: 'GenEdit', - meta: { title: '修改生成配置' } - } - ] - } -] + path: "edit/:tableId(\\d+)", + component: (resolve) => + require(["@/views/tool/gen/editTable"], resolve), + name: "GenEdit", + meta: { title: "修改生成配置" }, + }, + ], + }, +]; export default new Router({ // mode: 'hash', // 去掉url中的# - mode: 'history', // 去掉url中的# + mode: "history", // 去掉url中的# scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes -}) + routes: constantRoutes, +}); diff --git a/src/settings.js b/src/settings.js index 5b2ffd9..723c2d0 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,5 +1,5 @@ module.exports = { - title: '关键测试云平台', + title: '小关软测宝后台管理', /** * 侧边栏主题 深色主题theme-dark,浅色主题theme-light diff --git a/src/store/getters.js b/src/store/getters.js index 8231c20..0763e61 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -7,6 +7,7 @@ const getters = { token: state => state.user.token, avatar: state => state.user.avatar, name: state => state.user.name, + nickName: state => state.user.nickName, userId: state=> state.user.userId, introduction: state => state.user.introduction, roles: state => state.user.roles, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index b010e88..2746b48 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -15,6 +15,7 @@ const user = { messageCount:0, cartCount:0, userId:0, + nickName:'', activeName:'', activeNameManager: '', websiteDomain:'' @@ -27,6 +28,9 @@ const user = { SET_NAME: (state, name) => { state.name = name }, + SET_NICKNAME: (state, nickName) => { + state.nickName = nickName + }, SET_USERID:(state, userId) => { state.userId = userId }, @@ -138,7 +142,10 @@ const user = { } else { commit('SET_ROLES', ['ROLE_DEFAULT']) } + console.log(user); + commit('SET_NAME', user.userName) + commit('SET_NICKNAME', user.nickName) commit('SET_USERID', user.userId) commit('SET_AVATAR', avatar) commit('SET_COMPANY', user.companyStatus) diff --git a/src/utils/request.js b/src/utils/request.js index 194a288..2198eda 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,113 +1,122 @@ -import axios from 'axios' -import { Notification, MessageBox, Message } from 'element-ui' -import store from '@/store' -import { getToken } from '@/utils/auth' -import errorCode from '@/utils/errorCode' -import Cookies from 'js-cookie' +import axios from "axios"; +import { Notification, MessageBox, Message } from "element-ui"; +import store from "@/store"; +import { getToken } from "@/utils/auth"; +import errorCode from "@/utils/errorCode"; +import Cookies from "js-cookie"; -axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8"; // 创建axios实例 const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, // 超时 - timeout: 20000 -}) + timeout: 20000, +}); // request拦截器 -service.interceptors.request.use(config => { - // 是否需要设置 token - const isToken = (config.headers || {}).isToken === false +service.interceptors.request.use( + (config) => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false; - if (getToken() && !isToken) { - config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 - } + if (getToken() && !isToken) { + config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改 + } - // get请求映射params参数 - if (config.method === 'get' && config.params) { - let url = config.url + '?'; - for (const propName of Object.keys(config.params)) { - const value = config.params[propName]; - var part = encodeURIComponent(propName) + "="; - if (value !== null && typeof(value) !== "undefined") { - if (typeof value === 'object') { - for (const key of Object.keys(value)) { - let params = propName + '[' + key + ']'; - var subPart = encodeURIComponent(params) + "="; - url += subPart + encodeURIComponent(value[key]) + "&"; + // get请求映射params参数 + if (config.method === "get" && config.params) { + let url = config.url + "?"; + for (const propName of Object.keys(config.params)) { + const value = config.params[propName]; + var part = encodeURIComponent(propName) + "="; + if (value !== null && typeof value !== "undefined") { + if (typeof value === "object") { + for (const key of Object.keys(value)) { + let params = propName + "[" + key + "]"; + var subPart = encodeURIComponent(params) + "="; + url += subPart + encodeURIComponent(value[key]) + "&"; + } + } else { + url += part + encodeURIComponent(value) + "&"; } - } else { - url += part + encodeURIComponent(value) + "&"; } } + url = url.slice(0, -1); + config.params = {}; + config.url = url; } - url = url.slice(0, -1); - config.params = {}; - config.url = url; + return config; + }, + (error) => { + console.log(error); + Promise.reject(error); } - return config -}, error => { - console.log(error) - Promise.reject(error) -}) +); // 响应拦截器 -service.interceptors.response.use(res => { - // console.log('响应拦截器',res) +service.interceptors.response.use( + (res) => { + console.log(res); + + // console.log('响应拦截器',res) // 未设置状态码则默认成功状态 // const code = res.status || 200; - const code = res.data.code || 200 ; + const code = res.data.code || 200; // 获取错误信息 - const msg = errorCode[code] || res.data.msg || errorCode['default'] + const msg = errorCode[code] || res.data.msg || errorCode["default"]; // console.log('code---',code) if (code === 401) { // Cookies.set('Admin-Token', ''); - MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', { - confirmButtonText: '重新登录', - showCancelButton:false, - showClose:false, - type: 'warning' - } - ).then(() => { - store.dispatch('LogOut').then(() => { - location.href = '/index'; - }) - }) + MessageBox.confirm("登录状态已过期,请重新登录", "系统提示", { + confirmButtonText: "重新登录", + showCancelButton: false, + showClose: false, + type: "warning", + }).then(() => { + store.dispatch("LogOut").then(() => { + location.href = "/index"; + }); + }); } else if (code === 500) { Message({ message: msg, - type: 'error' - }) - return Promise.reject(new Error(msg)) - } - else if (code === 501) { + type: "error", + }); + return Promise.reject(new Error(msg)); + } else if (code === 501) { Message({ message: msg, - type: 'error' - }) - return Promise.reject(new Error(msg)) - } - else if (code == '200') { + type: "error", + }); + return Promise.reject(new Error(msg)); + } else if (code === 409) { + Message({ + message: msg, + type: "error", + }); + return Promise.reject(new Error(msg)); + } else if (code == "200") { // console.log('200',res.data) - return res.data + return res.data; } else if (code !== 200) { // Notification.error({ // title: msg // }) - return Promise.reject('error') - } else { - return res.data + return Promise.reject("error"); + } else { + return res.data; } }, - error => { + (error) => { // console.log('err' + error) let { message } = error; + console.log(error); + if (message == "Network Error") { message = "后端接口连接异常"; - } - else if (message.includes("timeout")) { + } else if (message.includes("timeout")) { message = "系统接口请求超时"; - } - else if (message.includes("Request failed with status code")) { + } else if (message.includes("Request failed with status code")) { message = "系统接口" + message.substr(message.length - 3) + "异常"; } // Message({ @@ -115,8 +124,8 @@ service.interceptors.response.use(res => { // type: 'error', // duration: 5 * 1000 // }) - return Promise.reject(error) + return Promise.reject(error); } -) +); -export default service +export default service; diff --git a/src/views/components/ToolEdit.vue b/src/views/components/ToolEdit.vue index 64ee3d3..567f602 100644 --- a/src/views/components/ToolEdit.vue +++ b/src/views/components/ToolEdit.vue @@ -1,6 +1,7 @@ - + @@ -97,7 +111,10 @@ @click="setSignTab(scope.row)">配置报名表 修改 删除 - 考勤 + 考勤 + 拷贝 @@ -105,7 +122,25 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> - + +
+ + + + + + +
+ + + 确认 + 取消 + +
+ @@ -216,9 +251,17 @@ 确 定
+ + + diff --git a/src/views/trainService/signupStudent.vue b/src/views/trainService/signupStudent.vue index 736faa4..d4c93be 100644 --- a/src/views/trainService/signupStudent.vue +++ b/src/views/trainService/signupStudent.vue @@ -16,8 +16,8 @@ - - + + @@ -29,11 +29,13 @@ 导出为excel + 导出评价 下载 + :default-sort="{ prop: 'asseGradeVag', order: 'descending' }" @selection-change="handleSelectionChange"> @@ -58,24 +60,39 @@ + + + - + + + + @@ -83,13 +100,67 @@ :limit.sync="queryParamss.pageSize" @pagination="getStudentList" /> - + width="650px" append-to-body @close="colsedia"> + - + + + + + + + + + + + + + +
+

平均分:{{ asseGradeVag + }}分

+
+
总数:{{ asseCount }}
+
加载更多...
+ +
+
+
+
+
+
+
{{ item.assessmentDate.substr(0, 10) }}
+
{{ item.grade }}分
+
+
评价老师:{{ item.assessmentBy }}
+
+
+
+
+ +
{{ item.content }}
+
{{ item.content }}
+
+
{{ item.content }}
+
+ 删除 +
+
+
+
开始
+
+
+ + 取 消 确 定 @@ -98,8 +169,13 @@ - +