|
|
|
|
@ -10,6 +10,7 @@ export const useTaskStore = defineStore({
|
|
|
|
|
activeId: '',
|
|
|
|
|
approvalList: [],
|
|
|
|
|
packageid: '',
|
|
|
|
|
refresh: false,
|
|
|
|
|
}),
|
|
|
|
|
getters: {
|
|
|
|
|
getActiveId: (state: TaskState) => state.activeId,
|
|
|
|
|
@ -41,12 +42,15 @@ export const useTaskStore = defineStore({
|
|
|
|
|
|
|
|
|
|
this.setActive(--this.currentIndex)
|
|
|
|
|
},
|
|
|
|
|
async fetchApprovalList(pagination, id) {
|
|
|
|
|
async fetchApprovalList(pagination, id, refresh?: boolean) {
|
|
|
|
|
const res = await getApprovalList(pagination, id)
|
|
|
|
|
this.setApprovalList(res.data)
|
|
|
|
|
|
|
|
|
|
if (res.data.length > 0)
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
this.setActive(0)
|
|
|
|
|
// 审批操作完成后,需要刷新,为防止activeId在刷新后值不变,通过此值刷新
|
|
|
|
|
this.refresh = !this.refresh
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return res.data
|
|
|
|
|
},
|
|
|
|
|
|