Commit 1a29ebc9 authored by liwei's avatar liwei

修改了分页返参

parent 6997a75f
......@@ -324,6 +324,7 @@ import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsApplication } from '@/api/contentManagement/application'
import { listCmsBanner } from '@/api/contentManagement/banner'
export default {
name: 'Index',
// components: {
......@@ -591,57 +592,17 @@ export default {
this.total2 = this.gridData1.length
this.loadData1()
},
/** 查询活动管理列表 */
loadData() {
// 列表渲染数据
var data = []
const _this = this
this.tableData = []
_this.fullscreenLoading = true
const params = {
page: _this.queryParams.page,
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
}
}
this.loading = true
listCmsActivity(this.queryParams).then(
response => {
// 处理分页数据里的url
this.tableData = response.data
this.total = response.total
this.loading = false
}
// 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) {
......
......@@ -381,27 +381,8 @@ export default {
this.loading = true
listCmsBanner(this.queryParams).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('response.rows:', response.rows)
// 处理分页数据里的url
this.cmsBannerList = response.rows
// console.log('this.cmsBannerList:', this.cmsBannerList)
this.cmsBannerList = response.data
this.total = response.total
this.loading = false
}
......
......@@ -180,6 +180,7 @@ import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsActivity } from '@/api/contentManagement/activity'
export default {
name: 'Index',
// components: {
......@@ -369,57 +370,17 @@ export default {
this.queryParams.endTime = ''
}
},
/** 查询公告管理列表 */
loadData() {
// 列表渲染数据
var data = []
const _this = this
this.tableData = []
_this.fullscreenLoading = true
const params = {
page: _this.queryParams.page,
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
}
this.loading = true
listCmsNotice(this.queryParams).then(
response => {
// 处理分页数据里的url
this.tableData = response.data
this.total = response.total
this.loading = false
}
}
// 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) {
......
......@@ -318,8 +318,8 @@ export default {
/** 查询字典类型列表 */
getList() {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.options = response.rows
this.typeList = response.rows
this.options = response.data
this.typeList = response.data
this.total = response.total
this.loading = false
}
......
......@@ -454,7 +454,7 @@ export default {
this.loading = true
listRole(this.queryParams).then(
response => {
this.roleList = response.rows
this.roleList = response.data
this.total = response.total
this.loading = false
}
......
......@@ -689,7 +689,7 @@ export default {
getList() {
this.loading = true
listUser(this.queryParams).then(response => {
this.userList = response.rows
this.userList = response.data
this.total = response.total
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