Commit ea0e104d authored by daywrite's avatar daywrite

修改分页

parent d6cc85ce
......@@ -51,6 +51,7 @@ let setUrlK = (o) => {
export function requestAPI (option, data) {
let _option = Object.assign({}, option)
if (dev && data && option.method === 'GET') {
_option.url += '?duplextrans'
_option.url += setUrlK(data)
data = {}
}
......
const dev = process.env.NODE_ENV === 'development'
let urlEnd = dev ? '?duplextrans' : ''
export default {
getScheduleList: {
url: '/vue/schedule/list' + urlEnd
url: '/vue/schedule/list'
},
// 获取查询条件
getScheduleFilter: {
url: '/vue/schedule/get-filter' + urlEnd
url: '/vue/schedule/get-filter'
},
// 新建待办事项获取下拉列表配置项
getSaveNew: {
url: '/vue/schedule/get-new' + urlEnd
url: '/vue/schedule/get-new'
},
// 搜索客户名称
getClientByName: {
url: '/vue/search/client-by-name' + urlEnd
url: '/vue/search/client-by-name'
},
// 保存待办事项
saveNewSchedule: {
url: '/vue/schedule/save-new' + urlEnd
url: '/vue/schedule/save-new'
},
saveEditSchedule: {
url: '/vue/schedule/save-edit' + urlEnd
url: '/vue/schedule/save-edit'
},
// 删除待办事项
deleteSchedule: {
url: '/vue/schedule/delete' + urlEnd
url: '/vue/schedule/delete'
},
// 留言
getCommentList: {
url: '/vue/comment/list' + urlEnd
url: '/vue/comment/list'
},
// 留言新建
saveNewComment: {
url: '/vue/comment/save-new' + urlEnd
url: '/vue/comment/save-new'
},
// 留言删除
deleteComment: {
url: '/vue/comment/delete' + urlEnd
url: '/vue/comment/delete'
}
}
......@@ -142,8 +142,8 @@ export default {
this.updateForm(search)
},
updateForm (form) {
let _form = Object.assign({}, this.form, form)
updateForm (search) {
let _form = Object.assign({}, this.form, search)
this.getScheduleList(_form)
},
......@@ -176,9 +176,9 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteSchedule)
requestAPI(api.deleteSchedule, { id })
.then((res) => {
console.log(res)
this.$message.success('删除成功')
})
}).catch(() => {
this.$message.info('取消删除')
......@@ -186,19 +186,21 @@ export default {
},
getScheduleList (form) {
requestAPI(api.getScheduleList)
.then((res) => {
const {
list = [],
pagenation = {},
thisUser = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
this.result.pagenation.totalcount = 120
this.result.thisUser = thisUser
})
let _page = this.result.pagenation
requestAPI(api.getScheduleList, {
...form,
page: _page.thispage
}).then((res) => {
const {
list = [],
pagenation = {},
thisUser = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
this.result.thisUser = thisUser
})
}
}
}
......@@ -229,7 +231,7 @@ export default {
}
i {
display: inline-block;
padding-right: 3px;
padding-right: 3px;
}
}
</style>
......@@ -45,7 +45,7 @@ export default {
// this.$parent.loadList()
},
handleCurrentChange (val) {
this.pager.page = val
this.pager.thispage = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
// this.$parent.loadList()
......
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