mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 09:42:48 +00:00
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import { Result } from '@/request/Result'
|
|
import { get, put } from '@/request/index'
|
|
import { type Ref } from 'vue'
|
|
|
|
import useStore from '@/stores'
|
|
const prefix: any = { _value: '/workspace/' }
|
|
Object.defineProperty(prefix, 'value', {
|
|
get: function () {
|
|
const { user } = useStore()
|
|
return this._value + user.getWorkspaceId() + '/application'
|
|
},
|
|
})
|
|
|
|
/**
|
|
* workflow历史版本
|
|
*/
|
|
const getWorkFlowVersion: (
|
|
application_id: string,
|
|
loading?: Ref<boolean>,
|
|
) => Promise<Result<any>> = (application_id, loading) => {
|
|
return get(`${prefix.value}/${application_id}/work_flow_version`, undefined, loading)
|
|
}
|
|
|
|
/**
|
|
* workflow历史版本详情
|
|
*/
|
|
const getWorkFlowVersionDetail: (
|
|
application_id: string,
|
|
application_version_id: string,
|
|
loading?: Ref<boolean>,
|
|
) => Promise<Result<any>> = (application_id, application_version_id, loading) => {
|
|
return get(
|
|
`${prefix.value}/${application_id}/work_flow_version/${application_version_id}`,
|
|
undefined,
|
|
loading,
|
|
)
|
|
}
|
|
/**
|
|
* 修改workflow历史版本
|
|
*/
|
|
const putWorkFlowVersion: (
|
|
application_id: string,
|
|
application_version_id: string,
|
|
data: any,
|
|
loading?: Ref<boolean>,
|
|
) => Promise<Result<any>> = (application_id, application_version_id, data, loading) => {
|
|
return put(
|
|
`${prefix.value}/${application_id}/work_flow_version/${application_version_id}`,
|
|
data,
|
|
undefined,
|
|
loading,
|
|
)
|
|
}
|
|
export default {
|
|
getWorkFlowVersion,
|
|
getWorkFlowVersionDetail,
|
|
putWorkFlowVersion,
|
|
}
|