diff --git a/src/pages/allocationReview/records/people.vue b/src/pages/allocationReview/records/people.vue index 7ab837b..ca38f35 100644 --- a/src/pages/allocationReview/records/people.vue +++ b/src/pages/allocationReview/records/people.vue @@ -100,6 +100,7 @@ export default { userCheck: false, users: [], userKeyword: '', + accountIds: [], checkedKeyword: '', checkedAllCheck: false, @@ -114,7 +115,7 @@ export default { }, userKeyword: function () { clearTimeout(this.searchTimer) - this.searchTimer = setTimeout(this.getNakadaiUser, 500) + this.searchTimer = setTimeout(this[this.userType ? 'getExpert' : 'getNakadaiUser'], 500) }, }, mounted () { @@ -130,22 +131,27 @@ export default { if (curRecords.length === 1) { this.checked = [] const res = await this.$post(`${this.api.assignedPersonnelList}?evaluationId=${row.evaluationId}&reportId=${curRecords[0].reportId}`) - const ids = res.accountIds - if (ids && ids.length) { - const { users, checked } = this - ids.forEach(e => { - const cur = users.find(n => n.accountId === e) - if (cur) { - cur.check = true - checked.push(cur) - } - }) - } + this.accountIds = res.accountIds + this.handleUserCheck() } this.loaded = true } catch (e) { } } }, + // 匹配用户选择框 + handleUserCheck () { + const ids = this.accountIds + if (ids && ids.length) { + const checked = [] + const { users } = this + ids.forEach(e => { + const cur = users.find(n => n.accountId === e) + cur.check = !!cur + cur && checked.push(cur) + }) + this.checked = checked + } + }, // 获取中台部门 async getNakadaiDep () { const res = await this.$post(this.api.treeListArch) @@ -194,12 +200,7 @@ export default { pageNum: 1, pageSize: 1000 }) - const list = page.records - const { checked } = this - list.forEach(e => { - e.check = !!checked.find(n => n.accountId === e.accountId) - }) - this.users = list + this.users = page.records this.getDetail(init) }, // 查询专家列表 @@ -207,15 +208,11 @@ export default { this.$post(this.api.expertList, { type: 1, pageNum: 1, - pageSize: 1000 + pageSize: 1000, + keyWord: this.userKeyword }).then(({ page }) => { - const list = page.records - const { checked } = this - list.forEach(e => { - e.check = !!checked.find(n => n.accountId === e.accountId) - }) - this.users = list - this.getDetail(1) + this.users = page.records + this.handleUserCheck() }).catch(err => { }) }, diff --git a/src/pages/expert/list/index.vue b/src/pages/expert/list/index.vue index bc65808..bda7c71 100644 --- a/src/pages/expert/list/index.vue +++ b/src/pages/expert/list/index.vue @@ -275,7 +275,7 @@ export default { const list = this.multipleSelection if (list.length) { try { - await this.$confirm(`确定要删除已选定的${list.length}份试卷吗?`, '提示', { + await this.$confirm(`确定要删除已选定的${list.length}条数据吗?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', diff --git a/src/plugins/requests/index.js b/src/plugins/requests/index.js index c2c8504..bca3cdd 100644 --- a/src/plugins/requests/index.js +++ b/src/plugins/requests/index.js @@ -3,7 +3,6 @@ import Util from "@/libs/util"; import router from "@/router/index"; import Setting from "@/setting"; import store from '@/store' - const { inIframe } = Setting const service = axios.create({ baseURL: Setting.apiBaseURL, @@ -14,7 +13,7 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8" // 请求拦截器 service.interceptors.request.use(config => { - let token = localStorage.getItem(inIframe ? 'review_token' : 'expert_token') + let token = localStorage.getItem(inIframe || router.app._route.path === '/theoryReview' ? 'review_token' : 'expert_token') if (token) config.headers.token = token return config }, err => { @@ -38,12 +37,12 @@ service.interceptors.response.use( // 账号互踢 if (!logouted) { Util.local.remove(Setting.storeKey) - localStorage.removeItem(inIframe ? 'review_token' : 'expert_token') + localStorage.removeItem(inIframe || router.app._route.path === '/theoryReview' ? 'review_token' : 'expert_token') window.top.exitSystem && window.top.exitSystem() Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!') localStorage.removeItem('reviewPath') setTimeout(() => { - inIframe || store.dispatch('user/logout') + if (!inIframe && !router.app._route.path === '/theoryReview') store.dispatch('user/logout') logouted = 0 }, 1500) logouted = 1 diff --git a/src/router/permission.js b/src/router/permission.js index 14fd94f..6251ed7 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -4,10 +4,10 @@ import Setting from '@/setting' router.beforeEach((to, from, next) => { document.title = Setting.titleSuffix - if (!Setting.inIframe && !localStorage.getItem('expert_token') && to.path !== '/login') { + if (!Setting.inIframe && !localStorage.getItem('expert_token') && to.path !== '/login' && to.path !== '/theoryReview') { next('/login') } else { next() - to.path !== '/theoryReview' && localStorage.setItem('reviewPath', to.fullPath) + Setting.inIframe && to.path !== '/theoryReview' && localStorage.setItem('reviewPath', to.fullPath) } })