parent
e640d8eb4e
commit
4ae9221882
7 changed files with 122 additions and 40 deletions
@ -1,24 +1,31 @@ |
||||
import { getDetail, submit } from '@/api/plugin/workflow/draft' |
||||
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) |
||||
}) |
||||
}) |
||||
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(() => { |
||||
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