| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import store from '@/store'
- import {
- State,
- Access,
- WorkflowState
- } from '@/constant'
- import request from '@/utils/request'
- import {
- addTenant,
- addUser
- } from '@/api/base'
- export function getAuditWorkflows (query, options) {
- const { pageNum: pageIndex, pageSize } = query
- const condition = { status: State.SUBMITTED }
- const access = store.getters.access
- const isFinal = access.has(Access.REVIEW_RELEASE_FINAL)
- if (!isFinal || !__JUMP_REVIEW__) {
- const arr = []
- if (isFinal) {
- arr.push(WorkflowState.FINAL_LEVEL)
- }
- if (access.has(Access.REVIEW_RELEASE_SECOND)) {
- arr.push(WorkflowState.SECOND_LEVEL)
- }
- if (access.has(Access.REVIEW_RELEASE_FIRST)) {
- arr.push(WorkflowState.FIRST_LEVEL)
- }
- condition.currentSeveralReviewedList = arr
- }
- return request({
- url: '/workflow/pageByPropertis',
- method: 'POST',
- data: {
- pageIndex, pageSize,
- param: addTenant({
- status: State.SUBMITTED,
- ...condition
- })
- },
- ...options
- })
- }
- export function getWorkflowsByUser (query, options) {
- const { pageNum: pageIndex, pageSize, ...params } = query
- return request({
- url: '/workflow/pageByPropertis',
- method: 'POST',
- data: {
- pageIndex, pageSize,
- param: addTenant(addUser(params, 'createBy'))
- },
- ...options
- })
- }
|