Commit 1a29ebc9 authored by liwei's avatar liwei

修改了分页返参

parent 6997a75f
...@@ -324,6 +324,7 @@ import { error } from 'autoprefixer/lib/utils' ...@@ -324,6 +324,7 @@ import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsApplication } from '@/api/contentManagement/application' import { listCmsApplication } from '@/api/contentManagement/application'
import { listCmsBanner } from '@/api/contentManagement/banner'
export default { export default {
name: 'Index', name: 'Index',
// components: { // components: {
...@@ -591,57 +592,17 @@ export default { ...@@ -591,57 +592,17 @@ export default {
this.total2 = this.gridData1.length this.total2 = this.gridData1.length
this.loadData1() this.loadData1()
}, },
/** 查询活动管理列表 */
loadData() { loadData() {
// 列表渲染数据 this.loading = true
var data = [] listCmsActivity(this.queryParams).then(
const _this = this response => {
this.tableData = [] // 处理分页数据里的url
_this.fullscreenLoading = true this.tableData = response.data
const params = { this.total = response.total
page: _this.queryParams.page, this.loading = false
rows: _this.queryParams.rows,
flag: _this.queryParams.flag,
// plate: _this.queryParams.plate,
beginTime: _this.queryParams.beginTime,
endTime: _this.queryParams.endTime
}
listCmsActivity(params).then(response => {
if (this.$store.getters.type === '1') { // 开启
// 遍历rows
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].path !== undefined) { // rows里的数据是path
const newUrl = updateResponseUrl(response.rows[i].path)
response.rows[i].path = newUrl
}
if (response.rows[i].url !== undefined) { // rows里的数据是url
const newUrl = updateResponseUrl(response.rows[i].url)
response.rows[i].url = newUrl
}
if (response.rows[i].avatarUrl !== undefined) { // rows里的数据是avatarUrl
const newUrl = updateResponseUrl(response.rows[i].avatarUrl)
response.rows[i].avatarUrl = newUrl
}
}
}
// console.log('res.rows:', res.rows)
_this.total = response.total// 总记录数
_this.bussid = []
response.rows.forEach(item => {
item.srclist = []
item.srclist.push(item.pictureId)
})
_this.tableData = response.rows
_this.fullscreenLoading = false
if (response.rows.length === 0) {
_this.tableDataTips = '暂无数据'
} }
this.pageKey++ )
}).catch(function() {
_this.fullscreenLoading = false
console.log(error)
})
_this.dataIsReady = true
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
}, },
/** 查看报名人数 */ /** 查看报名人数 */
handleClick(row) { handleClick(row) {
......
...@@ -381,27 +381,8 @@ export default { ...@@ -381,27 +381,8 @@ export default {
this.loading = true this.loading = true
listCmsBanner(this.queryParams).then( listCmsBanner(this.queryParams).then(
response => { response => {
if (this.$store.getters.type === '1') { // 开启
// 遍历rows
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].path !== undefined) { // rows里的数据是path
const newUrl = updateResponseUrl(response.rows[i].path)
response.rows[i].path = newUrl
}
if (response.rows[i].url !== undefined) { // rows里的数据是url
const newUrl = updateResponseUrl(response.rows[i].url)
response.rows[i].url = newUrl
}
if (response.rows[i].avatarUrl !== undefined) { // rows里的数据是avatarUrl
const newUrl = updateResponseUrl(response.rows[i].avatarUrl)
response.rows[i].avatarUrl = newUrl
}
}
}
console.log('response.rows:', response.rows)
// 处理分页数据里的url // 处理分页数据里的url
this.cmsBannerList = response.rows this.cmsBannerList = response.data
// console.log('this.cmsBannerList:', this.cmsBannerList)
this.total = response.total this.total = response.total
this.loading = false this.loading = false
} }
......
...@@ -180,6 +180,7 @@ import { updateResponseUrl } from '@/utils/updateUrl' ...@@ -180,6 +180,7 @@ import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils' import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsActivity } from '@/api/contentManagement/activity'
export default { export default {
name: 'Index', name: 'Index',
// components: { // components: {
...@@ -369,57 +370,17 @@ export default { ...@@ -369,57 +370,17 @@ export default {
this.queryParams.endTime = '' this.queryParams.endTime = ''
} }
}, },
/** 查询公告管理列表 */
loadData() { loadData() {
// 列表渲染数据 this.loading = true
var data = [] listCmsNotice(this.queryParams).then(
const _this = this response => {
this.tableData = [] // 处理分页数据里的url
_this.fullscreenLoading = true this.tableData = response.data
const params = { this.total = response.total
page: _this.queryParams.page, this.loading = false
rows: _this.queryParams.rows,
flag: _this.queryParams.flag,
// plate: _this.queryParams.plate,
beginTime: _this.queryParams.beginTime,
endTime: _this.queryParams.endTime
}
listCmsNotice(params).then(response => {
if (this.$store.getters.type === '1') { // 开启
// 遍历rows
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].path !== undefined) { // rows里的数据是path
const newUrl = updateResponseUrl(response.rows[i].path)
response.rows[i].path = newUrl
}
if (response.rows[i].url !== undefined) { // rows里的数据是url
const newUrl = updateResponseUrl(response.rows[i].url)
response.rows[i].url = newUrl
}
if (response.rows[i].avatarUrl !== undefined) { // rows里的数据是avatarUrl
const newUrl = updateResponseUrl(response.rows[i].avatarUrl)
response.rows[i].avatarUrl = newUrl
}
}
}
// console.log('res.rows:', res.rows)
_this.total = response.total// 总记录数
_this.bussid = []
response.rows.forEach(item => {
item.srclist = []
item.srclist.push(item.pictureId)
})
_this.tableData = response.rows
_this.fullscreenLoading = false
if (response.rows.length === 0) {
_this.tableDataTips = '暂无数据'
} }
this.pageKey++ )
}).catch(function() {
_this.fullscreenLoading = false
console.log(error)
})
_this.dataIseady = true
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
}, },
// 修改状态 // 修改状态
handleStatusChange(row) { handleStatusChange(row) {
......
...@@ -318,8 +318,8 @@ export default { ...@@ -318,8 +318,8 @@ export default {
/** 查询字典类型列表 */ /** 查询字典类型列表 */
getList() { getList() {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => { listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.options = response.rows this.options = response.data
this.typeList = response.rows this.typeList = response.data
this.total = response.total this.total = response.total
this.loading = false this.loading = false
} }
......
...@@ -454,7 +454,7 @@ export default { ...@@ -454,7 +454,7 @@ export default {
this.loading = true this.loading = true
listRole(this.queryParams).then( listRole(this.queryParams).then(
response => { response => {
this.roleList = response.rows this.roleList = response.data
this.total = response.total this.total = response.total
this.loading = false this.loading = false
} }
......
...@@ -689,7 +689,7 @@ export default { ...@@ -689,7 +689,7 @@ export default {
getList() { getList() {
this.loading = true this.loading = true
listUser(this.queryParams).then(response => { listUser(this.queryParams).then(response => {
this.userList = response.rows this.userList = response.data
this.total = response.total this.total = response.total
this.loading = false this.loading = false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment