// get請求獲取數據(有參數)
getDataList: function () {
this.$http.get('/api/edu_classroom', {
params: {
page: this.pageIndex,
size: this.pageSize,
sort: "createDate desc"
}
}).then((response) => {
this.dataList = response.data.data.records
this.total = response.data.data.total
})
},
//post請求查詢 事例
findDate: function () {
this.$http.post('/api/edu_classroom/findByEntity?page=' + this.pageIndex + '&size=' + this.pageSize, this.searchInfo).then((response) => {
this.dataList = response.data.data.records
this.total = response.data.data.total
})
},
//post請求新增
this.$http.post('/api/edu_classroom/add', this.info).then((response) => {
if (response.data.success) {
this.showDialog = false
this.getDataList()
this.$notify({
title: 'ok',
message: response.data.msg
})
} else {
this.$notify.error({
title: '錯誤',
message: response.data.msg
})
}
})
//post請求修改
this.$http.post('/api/edu_classroom/updateById', this.info).then((response) => {
if (response.data.success) {
this.showDialog = false
this.getDataList()
this.$notify({
title: 'ok',
message: response.data.msg
})
} else {
this.$notify.error({
title: '錯誤',
message: response.data.msg
})
}
})
}
// get請求 刪除操作
deleteHandle: function (id) {
// 處理IDS
var uuids = id ? [id] : this.dataListSelections.map(item => {
return item.uuid
})
// 提示用戶刪除
this.$confirm(`確定刪除操作?`, '提示', {
confirmButtonText: '確定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.get('/api/edu_classroom/removeByIds', {
params: {
uuids: uuids.join(',')
}
}).then((response) => {
this.$notify({
title: 'OK',
message: '刪除成功!'
})
this.getDataList()
})
}).catch(() => { })
},