[fix][V]:对接后端接口,并修改部分数据格式

master
Romesum 5 years ago
parent 3c4f0c5bb4
commit 39fc04667f

@ -2,7 +2,8 @@
<div>
<el-row>
<el-col :span="6" :offset="6">
学年<el-select v-model="year" size="small" >
学年
<el-select v-model="year" size="small">
<el-option
v-for="item in selectOptions1"
:key="item.value"
@ -14,7 +15,8 @@
</el-select>
</el-col>
<el-col :span="6">
学期<el-select v-model="semester" size="small" >
学期
<el-select v-model="semester" size="small">
<el-option
v-for="item in selectOptions2"
:key="item.value"
@ -35,29 +37,29 @@
name: "timeSelect",
data() {
return {
year:'1920',
semester:'2',
year: '2019',
semester: 2,
selectOptions1: [
{
value:'1718',
value: '2017',
label: '2017-2018年'
},
{
value:'1819',
value: '2018',
label: '2018-2019年'
},
{
value:'1920',
value: '2019',
label: '2019-2020年'
}
],
selectOptions2: [
{
value:'1',
value: 1,
label: '第一学期'
},
{
value:'2',
value: 2,
label: '第二学期'
}
],

@ -17,7 +17,7 @@
</div>
<el-table :data="tableDataComputed" border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="课程编号" prop="uc_id"></el-table-column>
<el-table-column label="课程编号" prop="ucId"></el-table-column>
<el-table-column label="课程名称" prop="name"></el-table-column>
<el-table-column label="软件名称" prop="software"></el-table-column>
<el-table-column label="授课班级" prop="classes"></el-table-column>
@ -135,25 +135,25 @@
},
selectOptions1: [
{
value: '1718',
value: '2017',
label: '2017-2018年'
},
{
value: '1819',
value: '2018',
label: '2018-2019年'
},
{
value: '1920',
value: '2019',
label: '2019-2020年'
}
],
selectOptions2: [
{
value: '1',
value: 1,
label: '第一学期'
},
{
value: '2',
value: 2,
label: '第二学期'
}
],
@ -162,7 +162,7 @@
methods: {
//
async load() {
this.tableData = await get('lb/course/courseManagement')
this.tableData = await get('lb/usercourse/findbyyearandsemester/'+this.$refs.timeSelect.year+'/'+this.$refs.timeSelect.semester)
},
//
addCourse() {
@ -178,11 +178,9 @@
this.courseForm = rowData
},
//
deleteCourse(rowData) {
showDialog("确认要删除吗?", this)
post('lb/user/deleteCourse', {
uid: rowData.uc_id
}).then(() => {
async deleteCourse(rowData) {
await showDialog("确认要删除吗?", this)
post('lb/usercourse/deleteusercourse/'+rowData.ucId).then(() => {
showSuccess("删除成功", this)
this.load()
}).catch(e => {
@ -198,14 +196,14 @@
await showDialog("确定要" + (this.edit ? '编辑' : '新增') + '吗?', this)
//
if (this.edit) {
await post('lb/usercourse/updatecourse', {
await post('lb/usercourse/updateusercourse', {
year: this.courseForm.year,
semester: this.courseForm.semester,
uc_id: this.courseForm.uc_id,
ucId: this.courseForm.ucId,
name: this.courseForm.name,
software: this.courseForm.software,
classes: this.courseForm.classes,
population: this.courseForm.population,
population: parseInt(this.courseForm.population),
remind: this.courseForm.remind,
isHaveDocuments: this.courseForm.isHaveDocuments
}).catch(async e => {
@ -224,7 +222,7 @@
name: this.courseForm.name,
software: this.courseForm.software,
classes: this.courseForm.classes,
population: this.courseForm.population,
population: parseInt(this.courseForm.population),
remind: this.courseForm.remind,
isHaveDocuments: this.courseForm.isHaveDocuments
}).catch(async e => {
@ -249,14 +247,9 @@
computed: {
tableDataComputed() {
return this.tableData.filter(data => !this.search
|| data.uc_id.toLowerCase().includes(this.search.toLowerCase())
|| data.u_id.toLowerCase().includes(this.search.toLowerCase())
|| data.name.toLowerCase().includes(this.search.toLowerCase())
|| data.software.toLowerCase().includes(this.search.toLowerCase())
|| data.classes.toLowerCase().includes(this.search.toLowerCase())
|| data.population.toLowerCase().includes(this.search.toLowerCase())
|| data.remind.toLowerCase().includes(this.search.toLowerCase())
|| data.isHaveDocuments.toLowerCase().includes(this.search.toLowerCase())
)
}
},

Loading…
Cancel
Save