mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:02:46 +00:00
feat: workflow version
This commit is contained in:
parent
20e11f5c87
commit
0837d606a1
|
|
@ -0,0 +1,51 @@
|
|||
import { Result } from '@/request/Result'
|
||||
import { get, put } from '@/request/index'
|
||||
import { type Ref } from 'vue'
|
||||
|
||||
const prefix = '/workspace/' + localStorage.getItem('workspace_id') + '/application'
|
||||
|
||||
/**
|
||||
* workflow历史版本
|
||||
*/
|
||||
const getWorkFlowVersion: (
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>,
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${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}/${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}/${application_id}/work_flow_version/${application_version_id}`,
|
||||
data,
|
||||
undefined,
|
||||
loading,
|
||||
)
|
||||
}
|
||||
export default {
|
||||
getWorkFlowVersion,
|
||||
getWorkFlowVersionDetail,
|
||||
putWorkFlowVersion,
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import workFlowVersionApi from '@/api/application/work-flow-version'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
|
|
@ -111,20 +111,20 @@ function editName(val: string, item: any) {
|
|||
const obj = {
|
||||
name: val
|
||||
}
|
||||
// applicationApi.putWorkFlowVersion(id as string, item.id, obj, loading).then(() => {
|
||||
// MsgSuccess(t('common.modifySuccess'))
|
||||
// item['writeStatus'] = false
|
||||
// getList()
|
||||
// })
|
||||
workFlowVersionApi.putWorkFlowVersion(id as string, item.id, obj, loading).then(() => {
|
||||
MsgSuccess(t('common.modifySuccess'))
|
||||
item['writeStatus'] = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
MsgError(t('views.applicationWorkflow.tip.nameMessage'))
|
||||
}
|
||||
}
|
||||
|
||||
function getList() {
|
||||
// applicationApi.getWorkFlowVersion(id, loading).then((res: any) => {
|
||||
// LogData.value = res.data
|
||||
// })
|
||||
workFlowVersionApi.getWorkFlowVersion(id, loading).then((res: any) => {
|
||||
LogData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue