parent
29e8a5c5ce
commit
fda19f9f12
7 changed files with 117 additions and 18 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,41 @@ |
||||
import request from '@/router/axios'; |
||||
|
||||
const prefix = '/api/blade-workflow/process/draft' |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: `${prefix}/list`, |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (params) => { |
||||
return request({ |
||||
url: `${prefix}/detail`, |
||||
method: 'get', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
export const remove = (ids) => { |
||||
return request({ |
||||
url: `${prefix}/remove`, |
||||
method: 'post', |
||||
params: { |
||||
ids, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const submit = (row) => { |
||||
return request({ |
||||
url: `${prefix}/submit`, |
||||
method: 'post', |
||||
data: row |
||||
}) |
||||
} |
||||
@ -0,0 +1,24 @@ |
||||
import { getDetail, submit } from '@/api/plugin/workflow/draft' |
||||
|
||||
export default { |
||||
methods: { |
||||
initDraft(processDefId) { |
||||
return new Promise((resolve) => { |
||||
getDetail({ processDefId, platform: 'pc' }).then(res => { |
||||
const { data } = res.data |
||||
if (data && data.variables && Object.keys(data.variables).length > 0) resolve(data.variables) |
||||
}) |
||||
}) |
||||
}, |
||||
handleDraft(processDefId, formKey, variables) { |
||||
this.$confirm('保存至草稿箱并关闭?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
submit({ processDefId, formKey, variables: JSON.stringify(variables), platform: 'pc' }).then(() => { |
||||
this.handleCloseTag('/plugin/workflow/process/start') |
||||
}) |
||||
}).catch(() => { |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue