yujialong 2 weeks ago
parent 40327a423f
commit 66b4c21343
  1. 42
      src/views/course/AddCurriculum.vue
  2. 4
      src/views/review/index.vue

@ -415,7 +415,6 @@ export default {
systemChecked: [],
curSystem: '',
projects: [],
projectAll: [],
projectKeyword: '',
checkedKeyword: '',
checkeds: [],
@ -442,7 +441,7 @@ export default {
projectKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterProject();
this.getProject();
}, 500);
},
checkedKeyword: function (val) {
@ -577,6 +576,7 @@ export default {
this.pageNo = 1;
this.getConfig();
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds))
},
//
getConfig () {
@ -609,26 +609,23 @@ export default {
}).catch(err => { })
},
//
getProject (item) {
async getProject (item, fromSystemChange) {
const checked = this.checkeds
this.curSystem = item.systemId
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
this.projectAll = JSON.parse(JSON.stringify(res)) //
if (item) this.curSystem = item.systemId
let res
if (!fromSystemChange) {
res = await this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${this.curSystem}&keyword=${this.projectKeyword}`)
}
const result = []
res.map(e => {
const projects = fromSystemChange ? this.projects : res
projects.map(e => {
//
const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId)
const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId))
e.check = include
result.push(e)
})
this.checkAll = !result.filter(e => !e.check).length
this.projects = result
}).catch(err => { })
},
//
filterProject () {
const val = this.projectKeyword
this.projects = this.projectAll.filter(e => e.projectName.includes(val))
},
//
systemChange (val, item) {
@ -640,7 +637,7 @@ export default {
})
}
this.projectKeyword = ''
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}&keyword=${this.projectKeyword}`).then(res => {
if (val) {
//
if (!this.mulSystem) {
@ -648,18 +645,18 @@ export default {
item.check = true
}
res.map(e => {
if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) {
if (!checkeds.find(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))) {
checkeds.push(e)
}
})
} else {
res.map(e => {
const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId)
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))
i === -1 || checkeds.splice(i, 1)
})
}
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
this.getProject(item)
this.getProject(item, 1)
}).catch(err => { })
},
//
@ -672,7 +669,7 @@ export default {
//
projectChange (val, item) {
const { systemId, paperId } = item
const i = this.checkeds.findIndex(e => (e.projectId == item.projectId && e.systemId == systemId) || e.paperId == paperId)
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId))
// push
if (val) {
this.checkeds.push(item)
@ -685,12 +682,11 @@ export default {
})
this.checkAll = !this.projects.find(e => !e.check) //
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
console.log("🚀 ~ file: AddCurriculum.vue ~ line 728 ~ projectChange ~ checkedAll", this.checkeds, item)
},
//
filterChecked () {
const val = this.checkedKeyword
this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val))
this.checkeds = this.checkedAll.filter(e => (e.projectName && e.projectName.includes(val)) || (e.paperName && e.paperName.includes(val)))
},
//
delProject (i, e) {
@ -701,9 +697,9 @@ export default {
this.checkeds.splice(i, 1)
// checkdisabled
if (e.systemId == this.curSystem) {
const { projectId } = e
const { projectId, paperId } = e
this.projects.map(n => {
if (n.projectId == projectId) {
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) {
n.check = false
}
})

@ -17,9 +17,9 @@ export default {
let url = `${location.origin}/reviewCenter/`
if (Setting.isDev) url = `http://192.168.31.125:8099/`
if (cache) {
url += `#${cache}${cache.includes('?') ? `&` : '?'}token=${sessionStorage.getItem('token')}`
url += `#${cache}${cache.includes('?') ? `&` : '?'}token=${sessionStorage.getItem('token')}&nakadai=1`
} else {
url += `#/myReview?token=${sessionStorage.getItem('token')}`
url += `#/myReview?token=${sessionStorage.getItem('token')}&nakadai=1`
}
url += `&v=${Date.now()}`
localStorage.setItem('review_token', sessionStorage.getItem('token'))

Loading…
Cancel
Save