From 59be73c83da51b06efe76ffecb98e0113696b85b Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 3 Mar 2021 14:23:08 +0800 Subject: [PATCH] . --- src/api/index.js | 4 +-- src/pages/assessment/list/index.vue | 2 +- src/pages/practice/list/index.vue | 2 +- src/pages/quesBank/list/quesBankType.vue | 35 ++++++++++++++++++++++-- src/pages/quesBank/list/quesDialog.vue | 15 +++++++++- src/pages/student/list/index.vue | 1 + src/pages/system/list/staff.vue | 24 ++++++++++++---- 7 files changed, 70 insertions(+), 13 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index a27a6a3..4c07fad 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -49,7 +49,7 @@ export default { studentGetWorkNumber: `management/student/getWorkNumber`, exportFailureStudent: `${Setting.apiBaseURL}/management/student/exportFailure`, uploadFileStudent: `${Setting.apiBaseURL}/management/student/uploadFile`, - downloadStudentTemp: 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658660956.xlsx', + downloadStudentTemp: 'http://39.108.250.202/template/%E8%80%83%E8%AF%95%E5%B9%B3%E5%8F%B0%E5%AD%A6%E7%94%9F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx', // 一级部门 addStaffPro: `management/staffProfessionalArchitecture/addStaffProfessionalArchitecture`, @@ -74,7 +74,7 @@ export default { getWorkNumber: `management/staff/getWorkNumber`, exportFailureStaff: `${Setting.apiBaseURL}/management/staff/exportFailure`, uploadFileStaff: `${Setting.apiBaseURL}/management/staff/managementUpload`, - downloadStaffTemp: `http://liuwanr.oss-cn-shenzhen.aliyuncs.com/xlsx/20201102/1604658763812.xlsx`, + downloadStaffTemp: `http://39.108.250.202/template/%E8%80%83%E8%AF%95%E5%B9%B3%E5%8F%B0%E5%91%98%E5%B7%A5%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 角色管理 getRole: `management/role/get`, diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index 6d61644..43903cb 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -626,7 +626,7 @@ export default { this.testPaperName = '' }, getCourses() { - this.$get(`${this.api.getCourses}?type=0`) + this.$get(`${this.api.getCourses}?type=0&schoolId=${this.clientId}`) .then(res => { this.coursesList = res.data.list }) diff --git a/src/pages/practice/list/index.vue b/src/pages/practice/list/index.vue index ce3fdc5..eef32a6 100644 --- a/src/pages/practice/list/index.vue +++ b/src/pages/practice/list/index.vue @@ -415,7 +415,7 @@ export default { this.testPaperName = '' }, getCourses() { - this.$get(`${this.api.getCourses}?type=1`) + this.$get(`${this.api.getCourses}?type=1&schoolId=${this.clientId}`) .then(res => { this.coursesList = res.data.list }) diff --git a/src/pages/quesBank/list/quesBankType.vue b/src/pages/quesBank/list/quesBankType.vue index 6beed9c..7963291 100644 --- a/src/pages/quesBank/list/quesBankType.vue +++ b/src/pages/quesBank/list/quesBankType.vue @@ -23,7 +23,7 @@ @@ -116,8 +116,34 @@ export default { } this.$post(this.api.listByPage,data) .then(res => { - this.listData = res.data.list.list + let list = res.data.list.list + let result = [] + list.map(n => { + n.source == 1 && result.push(n) + }) + list.map(n => { + n.source == 2 && result.push(n) + }) + this.listData = result this.total = res.data.list.totalCount + + let data1 = { + pageNum: 1, + pageSize: 10000, + schoolId: this.clientId, + source: 2 + } + this.$post(this.api.listByPage,data1) + .then(res => { + let original = this.listData + let list = res.data.list.list + original.map(n => { + if(n.source == 1){ + if(list.find(e => e.source == 2 && e.typeName == n.typeName)) n.typeName = n.typeName + '(内置)' + } + }) + this.listData = original + }).catch(err => {}) }).catch(err => {}) }, handleCurrentChange(val) { @@ -233,5 +259,8 @@ export default { \ No newline at end of file diff --git a/src/pages/quesBank/list/quesDialog.vue b/src/pages/quesBank/list/quesDialog.vue index b636e8d..64a57ab 100644 --- a/src/pages/quesBank/list/quesDialog.vue +++ b/src/pages/quesBank/list/quesDialog.vue @@ -260,7 +260,20 @@ export default { } this.$post(this.api.listByPage,data) .then(res => { - this.quesBankList = res.data.list.list + let list = res.data.list.list + let result = [] + list.map(n => { + n.source == 1 && result.push(n) + }) + list.map(n => { + n.source == 2 && result.push(n) + }) + result.map(n => { + if(n.source == 1){ + if(result.find(e => e.source == 2 && e.typeName == n.typeName)) n.typeName = n.typeName + '(内置)' + } + }) + this.quesBankList = result }) .catch(err => {}) }, diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index 38ecfce..17ee103 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -118,6 +118,7 @@ :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" + :data="{schoolId: this.clientId}" :action="this.api.uploadFileStudent" :file-list="uploadList" name="file" diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index b697a45..a53f60e 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -10,7 +10,7 @@
- +
新增员工 @@ -119,6 +119,7 @@ :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" + :data="{schoolId: this.clientId}" :on-exceed="handleExceed" :action="this.api.uploadFileStaff" :file-list="uploadList" @@ -264,7 +265,7 @@ export default { keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { - this.getData() + this.initData() },500) } }, @@ -306,17 +307,30 @@ export default { this.handleCheck(val2) }, getData(){ + let totalPage = Math.ceil((this.total - 1) / this.pageSize) + let currentPage = this.pageNo > totalPage ? totalPage : this.pageNo + this.pageNo = currentPage < 1 ? 1 : currentPage let data = { staffProfessionalArchitectureIds: this.oneDepartmentIds, staffGradeIds: this.twoDepartmentIds, searchContent: this.keyword, - schoolId: this.clientId + schoolId: this.clientId, + pageNum: this.pageNo, + pageSize: this.pageSize } this.$get(`${this.api.queryStaff}/${this.pageNo}/${this.pageSize}`,data).then(res => { - this.listData = res.data.staffList - this.total = res.data.total + this.listData = res.data.staffList.list + this.total = res.data.staffList.totalCount + if(!this.listData.length && this.total){ + this.pageNo-- + this.getData() + } }).catch(res => {}); }, + initData(){ + this.pageNo = 1 + this.getData() + }, getRoles(){ let data = { clientId: this.clientId