|
|
@ -98,10 +98,15 @@ |
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
<el-table-column prop="auth" label="项目权限" align="center"> |
|
|
|
<el-table-column prop="auth" label="项目权限" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ permissionsKeys[scope.row.projectPermissions] }} |
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<!-- <el-table-column prop="createUser" label="创建人" align="center"></el-table-column> --> |
|
|
|
|
|
|
|
<el-table-column prop="founder" label="创建人" align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ founderKeys[scope.row.founder] }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createUser" label="创建人" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> |
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -188,6 +193,11 @@ export default { |
|
|
|
components: { StudentTree }, |
|
|
|
components: { StudentTree }, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
founderKeys: { |
|
|
|
|
|
|
|
0: "系统", |
|
|
|
|
|
|
|
1: "老师" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cidList: [], |
|
|
|
permissionsKeys: { |
|
|
|
permissionsKeys: { |
|
|
|
0: "练习", |
|
|
|
0: "练习", |
|
|
|
1: "考核", |
|
|
|
1: "考核", |
|
|
@ -359,6 +369,9 @@ export default { |
|
|
|
this.curriculumList = res.data; |
|
|
|
this.curriculumList = res.data; |
|
|
|
if (this.curriculumList.length) { |
|
|
|
if (this.curriculumList.length) { |
|
|
|
this.form.curriculumId = this.curriculumList[0].cid; |
|
|
|
this.form.curriculumId = this.curriculumList[0].cid; |
|
|
|
|
|
|
|
for(let i=0;i<this.curriculumList.length; i++) { |
|
|
|
|
|
|
|
this.cidList.push(this.curriculumList[i].cid) |
|
|
|
|
|
|
|
} |
|
|
|
this.getProjectData(); |
|
|
|
this.getProjectData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
@ -366,24 +379,64 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getProjectData() { |
|
|
|
getProjectData() { |
|
|
|
this.$get(`${this.api.projectListByCourseId}?cid=${this.form.curriculumId}&permissions=1&projectName=${this.keyword}`).then(res => { |
|
|
|
// this.$get(`${this.api.projectListByCourseId}?cid=${this.form.curriculumId}&permissions=1&projectName=${this.keyword}`).then(res => { |
|
|
|
let { status, data } = res; |
|
|
|
// let { status, data } = res; |
|
|
|
if (status === 200 && data) { |
|
|
|
// console.log(data) |
|
|
|
let list = data; |
|
|
|
// if (status === 200 && data) { |
|
|
|
let result = []; |
|
|
|
// let list = data; |
|
|
|
list.map(n => { |
|
|
|
// let result = []; |
|
|
|
n.enable || result.push(n); |
|
|
|
// list.map(n => { |
|
|
|
|
|
|
|
// n.enable || result.push(n); |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// this.projectDataAll = result; |
|
|
|
|
|
|
|
// console.log(result) |
|
|
|
|
|
|
|
// this.total = result.length; |
|
|
|
|
|
|
|
// // this.handlePage(); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$get(this.api.getSystemIdBySchool).then(res => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.status == 200){ |
|
|
|
|
|
|
|
const systemList = res.data; |
|
|
|
|
|
|
|
// 如果systemId有历史记录,就取历史记录里的systemId,否则就取默认的systemId |
|
|
|
|
|
|
|
const systemId = systemList[0].id; |
|
|
|
|
|
|
|
console.log(this.keyword, |
|
|
|
|
|
|
|
this.page, |
|
|
|
|
|
|
|
this.pageSize) |
|
|
|
|
|
|
|
console.log(systemId) |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
platformId: 1, // 平台:职站:1 中台:3 |
|
|
|
|
|
|
|
founder: 2, // 创建人角色(0:系统 1:老师 2:全部) |
|
|
|
|
|
|
|
state: "", // 状态(0:草稿箱 1:已发布) |
|
|
|
|
|
|
|
permissions: 1, // 项目权限(0:练习 1:考核 2:竞赛) |
|
|
|
|
|
|
|
projectName: this.keyword, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
systemId |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.queryProjectManage, data).then(res => { |
|
|
|
|
|
|
|
// this.listData = res.data.records; |
|
|
|
|
|
|
|
// this.total = res.data.total; |
|
|
|
|
|
|
|
console.log(res.data) |
|
|
|
|
|
|
|
const { data: { records } } = res |
|
|
|
|
|
|
|
this.projectDataAll = records; |
|
|
|
|
|
|
|
this.total = records.length; |
|
|
|
|
|
|
|
console.log(this.projectDataAll) |
|
|
|
|
|
|
|
this.handlePage(); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.projectDataAll = result; |
|
|
|
}else{ |
|
|
|
this.total = result.length; |
|
|
|
|
|
|
|
this.handlePage(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handlePage() { |
|
|
|
handlePage() { |
|
|
|
let list = this.projectDataAll; |
|
|
|
let result = this.projectDataAll.slice((this.page - 1) * this.pageSize, this.page * this.pageSize); |
|
|
|
let result = list.slice((this.page - 1) * this.pageSize, this.page * this.pageSize); |
|
|
|
|
|
|
|
this.projectData = result; |
|
|
|
this.projectData = result; |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
initData() { |
|
|
|