diff --git a/.env.development b/.env.development index 32f1e1f..292bbd2 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,8 @@ VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api' VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999' +# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api' + # VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999' # VUE_APP_BASE_TARGET = 'http://172.16.36.180:9999' diff --git a/.env.production b/.env.production index b1d511a..c1cdd8d 100644 --- a/.env.production +++ b/.env.production @@ -5,9 +5,9 @@ ENV = 'production' VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_API = '/test-api' -VUE_APP_BASE_TARGET = 'https://www.keyitest.cn/prod-api' +# VUE_APP_BASE_TARGET = 'https://www.keyitest.cn/prod-api' # VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999' -# VUE_APP_BASE_TARGET = 'http://192.168.0.230:9999' +VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999/prod-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api' # VUE_APP_BASE_TARGET = 'http://www.keyitest.cn/prod-api' diff --git a/package.json b/package.json index b04b729..4897220 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "npm": "^10.3.0", "nprogress": "0.2.0", "qrcodejs2": "0.0.2", + "qs": "^6.1.2", "quill": "1.3.7", "quill-image-drop-module": "^1.0.3", "quill-image-extend-module": "^1.1.2", diff --git a/src/api/trainService/index.js b/src/api/trainService/index.js index 34c2cb1..d99e6ca 100644 --- a/src/api/trainService/index.js +++ b/src/api/trainService/index.js @@ -16,7 +16,6 @@ export function addSchool(data) { url: '/train/school/add', method: 'post', data, - }) } export function updateSchool(data) { @@ -24,8 +23,6 @@ export function updateSchool(data) { url: '/train/school/update', method: 'post', data, - - }) } @@ -33,7 +30,6 @@ export function delSchool(id) { return request({ url: `/train/school/del/?schoolId=${id}`, method: 'delete', - }) } @@ -235,7 +231,95 @@ export function getSwiperClass() { export function delteSwiper(id) { console.log(id); return request({ - url: '/train/admin/banner/'+id, + url: '/train/admin/banner/' + id, + method: 'delete', + }) +} + +// 获取所有班级 +export function getClassList() { + return request({ + url: '/train/admin/trainClasses', + method: 'get', + }) +} +// 获取所有课程 +export function getCourseList(params) { + return request({ + url: '/course/admin/findAll', + method: 'get', + params + }) +} + +// 增加课程 +export function addCourseItem(data) { + return request({ + url: '/course/admin/add', + method: 'post', + data:JSON.stringify(data) + }) +} + +// 修改课程 +export function putCourseItem(data) { + return request({ + url: '/course/admin/update', + method: 'post', + data + }) +} + +// 删除课程 +export function delCourse(id) { + return request({ + url: '/course/admin/' + id, + method: 'delete', + }) +} + +// 根据课程ID获取改课程下所有签到用户信息 +export function getSigninInfo(id) { + return request({ + url: '/course/admin/singin/' + id, + method: 'get', + }) +} +// 删除签到信息 +export function delSigninItem(id) { + return request({ + url: '/course/admin/singin/' + id, + method: 'delete', + }) +} +// 考勤删除 +export function delAttendance(id) { + return request({ + url: '/course/admin/singin/class/' + id, method: 'delete', }) +} +// 获取考勤信息表 +export function getAttendanceList(id) { + return request({ + url: '/course/admin/singin/class/' + id, + method: 'get', + }) +} + +// 导出考勤表 +export function exportAttendance(id) { + return request({ + url: '/course/admin/importSignIn/class/' + id, + method: 'get', + responseType: 'blob' + }) +} +// 导出所有签到信息 +export function exportSignIn(id) { + return request({ + url: '/course/admin/importSignIn/course/' + id, + method: 'get', + responseType: 'blob' + }) } \ No newline at end of file diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 066e39f..9887fdc 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -1,179 +1,217 @@ diff --git a/src/components/vueQr/index.vue b/src/components/vueQr/index.vue index cd4d2bb..4d507af 100644 --- a/src/components/vueQr/index.vue +++ b/src/components/vueQr/index.vue @@ -1,7 +1,12 @@ @@ -9,24 +14,47 @@ import vueQr from 'vue-qr' export default { props: { - signInInfo: Object + signInInfo: String, }, components: { - vueQr + vueQr, + }, + computed: {}, + created() { }, data() { return { + countDown: 300, + toggle: false, + openTime: '', + qrImage: '', } }, + computed: { + countDownShow() { + return (5 * 60 * 1000 - this.countDown / (60 * 1000)).toFixed(1) + }, + }, methods: { test(a, b) { - console.log("扫码成功"); - } - } + this.qrImage = a + }, + caleImage() { + this.toggle = !this.toggle + }, + }, } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index e7ca5ae..6563454 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -122,7 +122,7 @@ export const constantRoutes = [ component: (resolve) => require(['@/views/system/user/tester/c2ct'], resolve), name: 'tester', meta: { title: '测试资质认证', icon: 'user' } - } , + }, { path: 'message', component: (resolve) => require(['@/views/my/message'], resolve), @@ -157,6 +157,7 @@ export const constantRoutes = [ } ] }, + { path: '/test', component: Layout, @@ -246,6 +247,14 @@ export const constantRoutes = [ } ] }, + + // { + // path: '/signInInfoList', + // component: (resolve) => require(['@/views/trainService/courseManageCom/signInInfoList.vue'], resolve), + // name: 'signInList', + // meta: { title: '签到详情', icon: '' } + + // }, { path: '/job', component: Layout, diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index 521bdae..2e35fe2 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -105,39 +105,42 @@ export function download(fileName) { } // 通用下载方法 export function downloadHttp(filePath) { - window.location.href = baseURL + "/common/download/http?filePath=" + encodeURI(filePath) + "&delete=" + false; + // window.location.href = baseURL + "/common/download/http?filePath=" + encodeURI(filePath) + "&delete=" + false; + window.location.href = baseURL + encodeURI(filePath); } // 通用下载方法 export function downloadFast(filePath, loading) { -// window.location.href = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false; - var url = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false; - axios({ - method: 'get', - url: url, - responseType: 'blob', - headers: { 'Authorization': 'Bearer ' + getToken() } - }).then(res => { - try { - const aLink = document.createElement('a') - var blob = new Blob([res.data], {type: 'application/octet-stream'}) - // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名; - var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') - var contentDisposition = decodeURI(res.headers['content-disposition']) - var result = patt.exec(contentDisposition) - var fileName = result[1] - fileName = fileName.replace(/\"/g, '') - aLink.href = URL.createObjectURL(blob) - aLink.setAttribute('download', fileName) // 设置下载文件名称 - document.body.appendChild(aLink) - aLink.click() - document.body.removeChild(aLink); - loading.close(); - } catch (e) { - alert("文件异常,请联系管理员"); - loading.close(); - } - }) + // window.location.href = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false; + // var url = baseURL + "/common/download/fast?filePath=" + encodeURI(filePath) + "&delete=" + false; + // var url = baseURL + encodeURI(filePath); + var url = baseURL + filePath; + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then(res => { + try { + const aLink = document.createElement('a') + var blob = new Blob([res.data], { type: 'application/octet-stream' }) + // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名; + var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') + var contentDisposition = decodeURI(res.headers['content-disposition']) + var result = patt.exec(contentDisposition) + var fileName = result[1] + fileName = fileName.replace(/\"/g, '') + aLink.href = URL.createObjectURL(blob) + aLink.setAttribute('download', fileName) // 设置下载文件名称 + document.body.appendChild(aLink) + aLink.click() + document.body.removeChild(aLink); + loading.close(); + } catch (e) { + alert("文件异常,请联系管理员"); + loading.close(); + } + }) } // 字符串格式化(%s ) @@ -214,36 +217,36 @@ export function handleTree(data, id, parentId, children) { } // 任务类型 -export function findLabelValueByProp(dic, value, propl,label) { +export function findLabelValueByProp(dic, value, propl, label) { if (!value) return "" - const valueArr = (value+'').split(',') + const valueArr = (value + '').split(',') propl = propl ? propl : 'value'; label = label ? label : 'label'; let resultArr = [] if (validatenull(dic)) return value - - valueArr.forEach((it,i) => { - const index = dic.findIndex(item=>item[propl] == valueArr[i]) - if (index != -1) { - resultArr.push(dic[index][label]) - } + + valueArr.forEach((it, i) => { + const index = dic.findIndex(item => item[propl] == valueArr[i]) + if (index != -1) { + resultArr.push(dic[index][label]) + } }) return resultArr.join(',') - } - export function validatenull(val) { - if (typeof val === 'boolean') { - return false - } - if (typeof val === 'number') { - return false - } - if (val instanceof Array) { - if (val.length === 0) return true - } else if (val instanceof Object) { - if (JSON.stringify(val) === '{}') return true - } else { - if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') return true - return false - } - return false - } \ No newline at end of file +} +export function validatenull(val) { + if (typeof val === 'boolean') { + return false + } + if (typeof val === 'number') { + return false + } + if (val instanceof Array) { + if (val.length === 0) return true + } else if (val instanceof Object) { + if (JSON.stringify(val) === '{}') return true + } else { + if (val === 'null' || val == null || val === 'undefined' || val === undefined || val === '') return true + return false + } + return false +} \ No newline at end of file diff --git a/src/views/trainService/attendanceList.vue b/src/views/trainService/attendanceList.vue new file mode 100644 index 0000000..8062e50 --- /dev/null +++ b/src/views/trainService/attendanceList.vue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/src/views/trainService/courseManage.vue b/src/views/trainService/courseManage.vue index eb2f6ba..7ee2362 100644 --- a/src/views/trainService/courseManage.vue +++ b/src/views/trainService/courseManage.vue @@ -1,38 +1,52 @@ - + - -
- + +
+
- - - - + + + + - - + + - - - - - + + + + + + + + - +
- +
- -
- - - - - - - - - - 确认 - 取消 + 确认 + 取消
- diff --git a/src/views/trainService/imageTemp/1.jpg b/src/views/trainService/imageTemp/1.jpg deleted file mode 100644 index d2885ed..0000000 Binary files a/src/views/trainService/imageTemp/1.jpg and /dev/null differ diff --git a/src/views/trainService/imageTemp/2.jpg b/src/views/trainService/imageTemp/2.jpg deleted file mode 100644 index 241d885..0000000 Binary files a/src/views/trainService/imageTemp/2.jpg and /dev/null differ diff --git a/src/views/trainService/imageTemp/peixun2.png b/src/views/trainService/imageTemp/peixun2.png deleted file mode 100644 index 928d7d5..0000000 Binary files a/src/views/trainService/imageTemp/peixun2.png and /dev/null differ diff --git a/src/views/trainService/imageTemp/peixun3.png b/src/views/trainService/imageTemp/peixun3.png deleted file mode 100644 index ed88997..0000000 Binary files a/src/views/trainService/imageTemp/peixun3.png and /dev/null differ diff --git a/src/views/trainService/signInInfoList.vue b/src/views/trainService/signInInfoList.vue new file mode 100644 index 0000000..37c3690 --- /dev/null +++ b/src/views/trainService/signInInfoList.vue @@ -0,0 +1,96 @@ + + + + + \ No newline at end of file diff --git a/src/views/trainService/signlist.vue b/src/views/trainService/signlist.vue index c239fac..f04d795 100644 --- a/src/views/trainService/signlist.vue +++ b/src/views/trainService/signlist.vue @@ -110,6 +110,7 @@ > 修改 删除 + 考勤 @@ -458,6 +459,16 @@ export default { }) } }, + option(row) { + console.log(row); + this.$router.push({ + path: '/attendanceList', + query: { + name: row.trainClassName, + id: row.trainClassId, + }, + }) + }, async delrow(row) { this.$confirm('是否确认删除培训班?', '提示', { confirmButtonText: '确定', diff --git a/src/views/trainService/swiperManager.vue b/src/views/trainService/swiperManager.vue index 8ef8f51..6a76e23 100644 --- a/src/views/trainService/swiperManager.vue +++ b/src/views/trainService/swiperManager.vue @@ -63,8 +63,8 @@ - +