20 changed files with 349 additions and 94 deletions
@ -0,0 +1,5 @@ |
|||||||
|
import { defHttp } from '@/utils/http/axios' |
||||||
|
|
||||||
|
export function getActivityList(params) { |
||||||
|
return defHttp.get({ url: '/bpm/activity/list', params }) |
||||||
|
} |
@ -1,39 +0,0 @@ |
|||||||
export interface FormVO { |
|
||||||
id: number |
|
||||||
name: string |
|
||||||
conf: string |
|
||||||
fields: string[] |
|
||||||
status: number |
|
||||||
remark: string |
|
||||||
createTime: string |
|
||||||
} |
|
||||||
|
|
||||||
export interface TaskProcessVO { |
|
||||||
id: string |
|
||||||
name: string |
|
||||||
startUserId: number |
|
||||||
startUserNickname: string |
|
||||||
processDefinitionId: string |
|
||||||
} |
|
||||||
|
|
||||||
export interface TaskTodoVO { |
|
||||||
id: string |
|
||||||
name: string |
|
||||||
claimTime: string |
|
||||||
createTime: string |
|
||||||
suspensionState: number |
|
||||||
processInstance: TaskProcessVO |
|
||||||
} |
|
||||||
|
|
||||||
export interface TaskDoneVO { |
|
||||||
id: string |
|
||||||
name: string |
|
||||||
claimTime: string |
|
||||||
createTime: string |
|
||||||
endTime: string |
|
||||||
durationInMillis: number |
|
||||||
suspensionState: number |
|
||||||
result: number |
|
||||||
reason: string |
|
||||||
processInstance: TaskProcessVO |
|
||||||
} |
|
@ -0,0 +1,78 @@ |
|||||||
|
<script lang="ts" setup> |
||||||
|
import { useI18n } from '@/hooks/web/useI18n' |
||||||
|
import { useMessage } from '@/hooks/web/useMessage' |
||||||
|
import type { FormSchema } from '@/components/Form' |
||||||
|
import { BasicForm, useForm } from '@/components/Form' |
||||||
|
import { BasicModal, useModalInner } from '@/components/Modal' |
||||||
|
import { importModel } from '@/api/bpm/model' |
||||||
|
|
||||||
|
defineOptions({ name: 'ModelImportForm' }) |
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']) |
||||||
|
|
||||||
|
const formSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
label: '流程标识', |
||||||
|
field: 'key', |
||||||
|
component: 'Input', |
||||||
|
required: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '流程名称', |
||||||
|
field: 'name', |
||||||
|
component: 'Input', |
||||||
|
required: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '流程描述', |
||||||
|
field: 'description', |
||||||
|
component: 'Input', |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '流程文件', |
||||||
|
field: 'bpmnFile', |
||||||
|
component: 'FileUpload', |
||||||
|
componentProps: { |
||||||
|
maxCount: 1, |
||||||
|
fileType: 'file', |
||||||
|
}, |
||||||
|
}, |
||||||
|
] |
||||||
|
|
||||||
|
const { t } = useI18n() |
||||||
|
const { createMessage } = useMessage() |
||||||
|
|
||||||
|
const [registerForm, { resetFields, validate }] = useForm({ |
||||||
|
labelWidth: 120, |
||||||
|
baseColProps: { span: 24 }, |
||||||
|
schemas: formSchema, |
||||||
|
showActionButtonGroup: false, |
||||||
|
actionColOptions: { span: 23 }, |
||||||
|
}) |
||||||
|
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => { |
||||||
|
resetFields() |
||||||
|
setModalProps({ confirmLoading: false }) |
||||||
|
}) |
||||||
|
|
||||||
|
async function handleSubmit() { |
||||||
|
try { |
||||||
|
const values = await validate() |
||||||
|
setModalProps({ confirmLoading: true }) |
||||||
|
console.info(values) |
||||||
|
await importModel(values) |
||||||
|
closeModal() |
||||||
|
emit('success') |
||||||
|
createMessage.success(t('common.saveSuccessText')) |
||||||
|
} |
||||||
|
finally { |
||||||
|
setModalProps({ confirmLoading: false }) |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<template> |
||||||
|
<BasicModal v-bind="$attrs" title="导入流程" @register="registerModal" @ok="handleSubmit"> |
||||||
|
<BasicForm @register="registerForm" /> |
||||||
|
</BasicModal> |
||||||
|
</template> |
@ -1,3 +1,42 @@ |
|||||||
|
<script lang="ts" setup> |
||||||
|
import { onMounted } from 'vue' |
||||||
|
import { formSchema } from './leave.data' |
||||||
|
import { BasicForm, useForm } from '@/components/Form' |
||||||
|
import { PageWrapper } from '@/components/Page' |
||||||
|
import { createLeave } from '@/api/bpm/leave' |
||||||
|
import { useI18n } from '@/hooks/web/useI18n' |
||||||
|
import { useMessage } from '@/hooks/web/useMessage' |
||||||
|
|
||||||
|
defineOptions({ name: 'LeaveCreate' }) |
||||||
|
const { t } = useI18n() |
||||||
|
const { createMessage } = useMessage() |
||||||
|
|
||||||
|
const [registerForm, { resetFields, validate }] = useForm({ |
||||||
|
labelWidth: 140, |
||||||
|
baseColProps: { span: 24 }, |
||||||
|
schemas: formSchema, |
||||||
|
showResetButton: false, |
||||||
|
submitButtonOptions: { text: t('common.saveText') }, |
||||||
|
actionColOptions: { span: 23 }, |
||||||
|
}) |
||||||
|
|
||||||
|
async function handleSubmit() { |
||||||
|
try { |
||||||
|
const values = await validate() |
||||||
|
await createLeave(values) |
||||||
|
} |
||||||
|
finally { |
||||||
|
createMessage.success(t('common.saveSuccessText')) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
onMounted(() => { |
||||||
|
resetFields() |
||||||
|
}) |
||||||
|
</script> |
||||||
|
|
||||||
<template> |
<template> |
||||||
123 |
<PageWrapper> |
||||||
|
<BasicForm class="mt-10 w-200 h-120" @register="registerForm" @submit="handleSubmit" /> |
||||||
|
</PageWrapper> |
||||||
</template> |
</template> |
||||||
|
@ -1,3 +1,40 @@ |
|||||||
|
<script lang="ts" setup> |
||||||
|
import { onMounted, ref } from 'vue' |
||||||
|
import { useRoute } from 'vue-router' |
||||||
|
import { descSchema } from './leave.data' |
||||||
|
import { Description, useDescription } from '@/components/Description' |
||||||
|
import { PageWrapper } from '@/components/Page' |
||||||
|
import { getLeave } from '@/api/bpm/leave' |
||||||
|
import { propTypes } from '@/utils/propTypes' |
||||||
|
|
||||||
|
defineOptions({ name: 'InfraJobModal' }) |
||||||
|
|
||||||
|
const props = defineProps({ |
||||||
|
id: propTypes.number.def(undefined), |
||||||
|
}) |
||||||
|
|
||||||
|
const { query } = useRoute() |
||||||
|
const datas = ref() |
||||||
|
|
||||||
|
const [registerDesc] = useDescription({ |
||||||
|
schema: descSchema, |
||||||
|
data: datas, |
||||||
|
}) |
||||||
|
|
||||||
|
async function getInfo() { |
||||||
|
const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编号 |
||||||
|
const res = await getLeave(props.id || queryId) |
||||||
|
datas.value = res |
||||||
|
} |
||||||
|
|
||||||
|
/** 初始化 **/ |
||||||
|
onMounted(async () => { |
||||||
|
await getInfo() |
||||||
|
}) |
||||||
|
</script> |
||||||
|
|
||||||
<template> |
<template> |
||||||
123 |
<PageWrapper> |
||||||
|
<Description :column="1" @register="registerDesc" /> |
||||||
|
</PageWrapper> |
||||||
</template> |
</template> |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
<template> |
<template> |
||||||
123 |
<div>123</div> |
||||||
</template> |
</template> |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
<template> |
<template> |
||||||
123 |
<div>123</div> |
||||||
</template> |
</template> |
||||||
|
Reference in new issue