2022-11-03 16:55:01 +08:00
|
|
|
import request from '@/config/axios'
|
2022-07-28 12:18:38 +08:00
|
|
|
import { ModelVO } from './types'
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const getModelPageApi = async (params) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.get({ url: '/bpm/model/page', params })
|
|
|
|
}
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const getModelApi = async (id: number) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.get({ url: '/bpm/model/get?id=' + id })
|
|
|
|
}
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const updateModelApi = async (data: ModelVO) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.put({ url: '/bpm/model/update', data: data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 任务状态修改
|
2022-07-28 19:10:45 +08:00
|
|
|
export const updateModelStateApi = async (id: number, state: number) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
const data = {
|
|
|
|
id: id,
|
|
|
|
state: state
|
|
|
|
}
|
|
|
|
return await request.put({ url: '/bpm/model/update-state', data: data })
|
|
|
|
}
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const createModelApi = async (data: ModelVO) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.post({ url: '/bpm/model/create', data: data })
|
|
|
|
}
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const deleteModelApi = async (id: number) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.delete({ url: '/bpm/model/delete?id=' + id })
|
|
|
|
}
|
|
|
|
|
2022-07-28 19:10:45 +08:00
|
|
|
export const deployModelApi = async (id: number) => {
|
2022-07-28 12:18:38 +08:00
|
|
|
return await request.post({ url: '/bpm/model/deploy?id=' + id })
|
|
|
|
}
|