yujialong 3 weeks ago
parent 04dc2b2432
commit 2329fa7547
  1. 47
      src/pages/allocationReview/records/people.vue
  2. 2
      src/pages/expert/list/index.vue
  3. 7
      src/plugins/requests/index.js
  4. 4
      src/router/permission.js

@ -100,6 +100,7 @@ export default {
userCheck: false, userCheck: false,
users: [], users: [],
userKeyword: '', userKeyword: '',
accountIds: [],
checkedKeyword: '', checkedKeyword: '',
checkedAllCheck: false, checkedAllCheck: false,
@ -114,7 +115,7 @@ export default {
}, },
userKeyword: function () { userKeyword: function () {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.getNakadaiUser, 500) this.searchTimer = setTimeout(this[this.userType ? 'getExpert' : 'getNakadaiUser'], 500)
}, },
}, },
mounted () { mounted () {
@ -130,20 +131,25 @@ export default {
if (curRecords.length === 1) { if (curRecords.length === 1) {
this.checked = [] this.checked = []
const res = await this.$post(`${this.api.assignedPersonnelList}?evaluationId=${row.evaluationId}&reportId=${curRecords[0].reportId}`) const res = await this.$post(`${this.api.assignedPersonnelList}?evaluationId=${row.evaluationId}&reportId=${curRecords[0].reportId}`)
const ids = res.accountIds this.accountIds = res.accountIds
this.handleUserCheck()
}
this.loaded = true
} catch (e) { }
}
},
//
handleUserCheck () {
const ids = this.accountIds
if (ids && ids.length) { if (ids && ids.length) {
const { users, checked } = this const checked = []
const { users } = this
ids.forEach(e => { ids.forEach(e => {
const cur = users.find(n => n.accountId === e) const cur = users.find(n => n.accountId === e)
if (cur) { cur.check = !!cur
cur.check = true cur && checked.push(cur)
checked.push(cur)
}
}) })
} this.checked = checked
}
this.loaded = true
} catch (e) { }
} }
}, },
// //
@ -194,12 +200,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 1000 pageSize: 1000
}) })
const list = page.records this.users = page.records
const { checked } = this
list.forEach(e => {
e.check = !!checked.find(n => n.accountId === e.accountId)
})
this.users = list
this.getDetail(init) this.getDetail(init)
}, },
// //
@ -207,15 +208,11 @@ export default {
this.$post(this.api.expertList, { this.$post(this.api.expertList, {
type: 1, type: 1,
pageNum: 1, pageNum: 1,
pageSize: 1000 pageSize: 1000,
keyWord: this.userKeyword
}).then(({ page }) => { }).then(({ page }) => {
const list = page.records this.users = page.records
const { checked } = this this.handleUserCheck()
list.forEach(e => {
e.check = !!checked.find(n => n.accountId === e.accountId)
})
this.users = list
this.getDetail(1)
}).catch(err => { }) }).catch(err => { })
}, },

@ -275,7 +275,7 @@ export default {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length) { if (list.length) {
try { try {
await this.$confirm(`确定要删除已选定的${list.length}份试卷吗?`, '提示', { await this.$confirm(`确定要删除已选定的${list.length}条数据吗?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',

@ -3,7 +3,6 @@ import Util from "@/libs/util";
import router from "@/router/index"; import router from "@/router/index";
import Setting from "@/setting"; import Setting from "@/setting";
import store from '@/store' import store from '@/store'
const { inIframe } = Setting const { inIframe } = Setting
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
@ -14,7 +13,7 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"
// 请求拦截器 // 请求拦截器
service.interceptors.request.use(config => { 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 if (token) config.headers.token = token
return config return config
}, err => { }, err => {
@ -38,12 +37,12 @@ service.interceptors.response.use(
// 账号互踢 // 账号互踢
if (!logouted) { if (!logouted) {
Util.local.remove(Setting.storeKey) 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() window.top.exitSystem && window.top.exitSystem()
Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!') Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
localStorage.removeItem('reviewPath') localStorage.removeItem('reviewPath')
setTimeout(() => { setTimeout(() => {
inIframe || store.dispatch('user/logout') if (!inIframe && !router.app._route.path === '/theoryReview') store.dispatch('user/logout')
logouted = 0 logouted = 0
}, 1500) }, 1500)
logouted = 1 logouted = 1

@ -4,10 +4,10 @@ import Setting from '@/setting'
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix 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') next('/login')
} else { } else {
next() next()
to.path !== '/theoryReview' && localStorage.setItem('reviewPath', to.fullPath) Setting.inIframe && to.path !== '/theoryReview' && localStorage.setItem('reviewPath', to.fullPath)
} }
}) })

Loading…
Cancel
Save