Commit acece46d authored by jingnan's avatar jingnan 👀

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

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