feat: workflow version
This commit is contained in:
parent
20e11f5c87
commit
0837d606a1
51
ui/src/api/application/work-flow-version.ts
Normal file
51
ui/src/api/application/work-flow-version.ts
Normal file
@ -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">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
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 { datetimeFormat } from '@/utils/time'
|
||||||
import { MsgSuccess, MsgError } from '@/utils/message'
|
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
@ -111,20 +111,20 @@ function editName(val: string, item: any) {
|
|||||||
const obj = {
|
const obj = {
|
||||||
name: val
|
name: val
|
||||||
}
|
}
|
||||||
// applicationApi.putWorkFlowVersion(id as string, item.id, obj, loading).then(() => {
|
workFlowVersionApi.putWorkFlowVersion(id as string, item.id, obj, loading).then(() => {
|
||||||
// MsgSuccess(t('common.modifySuccess'))
|
MsgSuccess(t('common.modifySuccess'))
|
||||||
// item['writeStatus'] = false
|
item['writeStatus'] = false
|
||||||
// getList()
|
getList()
|
||||||
// })
|
})
|
||||||
} else {
|
} else {
|
||||||
MsgError(t('views.applicationWorkflow.tip.nameMessage'))
|
MsgError(t('views.applicationWorkflow.tip.nameMessage'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
// applicationApi.getWorkFlowVersion(id, loading).then((res: any) => {
|
workFlowVersionApi.getWorkFlowVersion(id, loading).then((res: any) => {
|
||||||
// LogData.value = res.data
|
LogData.value = res.data
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user