Commit acece46d authored by jingnan's avatar jingnan 👀

首页待办删除分页(接口未使用分页)

parent 43236cd6
......@@ -28,10 +28,10 @@
</div>
</div>
</div>
<div v-if="!initShowFont" class="more-bar">
<span v-if="taskList.length < pagination.total" class="more" @click="getMoreTaskData">加载更多</span>
<span v-else>已全部加载!</span>
</div>
<!-- <div v-if="!initShowFont" class="more-bar"> -->
<!-- <span v-if="taskList.length < pagination.total" class="more" @click="getMoreTaskData">加载更多</span> -->
<!-- <span>已全部加载!</span> -->
<!-- </div> -->
</el-scrollbar>
</div>
</template>
......@@ -42,7 +42,7 @@ import { getTemps } from '@/api/workflow/userSettings.js'
import { getAllApplication } from '@/api/workflow/config'
// import { getTaskCount } from '@/api/workspace.js'
// import _get from 'lodash.get'
import { post, get } from '@/utils/http'
import { get } from '@/utils/http'
export default {
name: 'MyTask',
......@@ -64,12 +64,12 @@ export default {
isShowMoreFont: true,
initShowFont: false,
taskList: [],
pagination: {
currentPage: 1,
pageSize: 10,
pageSizes: [5],
total: 0
},
// pagination: {
// currentPage: 1,
// pageSize: 10,
// pageSizes: [5],
// total: 0
// },
search: '',
pageCount: 0,
clickNum: 1,
......@@ -232,40 +232,40 @@ export default {
// 获取待办任务列表
getTasks(page, type) {
this.getOthersTasks(type)
const params = {
'page': page || this.pagination.currentPage,
'size': this.pagination.pageSize
}
params.assignee = localStorage.getItem('userId')
if (this.searchForm.receiveTimeRange && this.searchForm.receiveTimeRange.length) {
params.receiveTime1 = this.searchForm.receiveTimeRange[0] + ' 00:00:00'
params.receiveTime2 = this.searchForm.receiveTimeRange[1] + ' 23:59:59'
}
// const params = {
// 'page': page || this.pagination.currentPage,
// 'size': this.pagination.pageSize
// }
// params.assignee = localStorage.getItem('userId')
// if (this.searchForm.receiveTimeRange && this.searchForm.receiveTimeRange.length) {
// params.receiveTime1 = this.searchForm.receiveTimeRange[0] + ' 00:00:00'
// params.receiveTime2 = this.searchForm.receiveTimeRange[1] + ' 23:59:59'
// }
this.type = type
if (type === '单个签审') {
get('/indexTask/task/todoStatistics').then(res => {
if (params.page === 1) {
this.taskList = []
}
// if (params.page === 1) {
// this.taskList = []
// }
this.addData(res.items, res.items.length)
})
}
if (type === '已办任务') {
get('/indexTask/task/finishStatistics').then(res => {
if (params.page === 1) {
this.taskList = []
}
// if (params.page === 1) {
// this.taskList = []
// }
this.addData(res.items, res.items.length)
})
}
if (type === '我的请求') {
post(`/workflow/inst?page=${params.page}&size=${params.size}`, { 'startedUserId': localStorage.getItem('userId'), 'checkOwnerSignAddFlag': true }).then(res => {
if (params.page === 1) {
this.taskList = []
}
this.addData(res.items.content, res.items.totalElements)
})
}
// if (type === '我的请求') {
// post(`/workflow/inst?page=${params.page}&size=${params.size}`, { 'startedUserId': localStorage.getItem('userId'), 'checkOwnerSignAddFlag': true }).then(res => {
// if (params.page === 1) {
// this.taskList = []
// }
// this.addData(res.items.content, res.items.totalElements)
// })
// }
},
addData(data, totalElements) {
data.forEach((item) => {
......@@ -275,7 +275,7 @@ export default {
})
}
})
this.pagination.total = totalElements
// this.pagination.total = totalElements
},
showIcon(row) {
return showIcon(row)
......@@ -361,7 +361,7 @@ export default {
},
getMoreTaskData() {
if (this.clickNum !== this.pageCount) {
this.pagination.currentPage += 1
// this.pagination.currentPage += 1
this.getTasks(this.pagination.currentPage, this.type)
this.clickNum += 1
}
......
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