mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-14 02:45:06 +08:00
【代码评审】工作流:快搭部分的 code review
This commit is contained in:
@ -56,12 +56,14 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; margin-left: 10%; font-size: 14px">
|
||||
<!-- TODO @jason:建议搞个 if 来判断,替代现有的 !item.buttonsSetting || item.buttonsSetting[OpsButtonType.APPROVE]?.enable -->
|
||||
<el-button
|
||||
type="success"
|
||||
v-if="!item.buttonsSetting || item.buttonsSetting[OpsButtonType.APPROVE]?.enable"
|
||||
@click="handleAudit(item, true)"
|
||||
>
|
||||
<Icon icon="ep:select" />
|
||||
<!-- TODO @jason:这个也是类似哈,搞个方法来生成名字 -->
|
||||
{{
|
||||
item.buttonsSetting?.[OpsButtonType.APPROVE]?.displayName ||
|
||||
OPERATION_BUTTON_NAME.get(OpsButtonType.APPROVE)
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<SimpleProcessDesigner :model-id="modelId"/>
|
||||
<SimpleProcessDesigner :model-id="modelId" />
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { SimpleProcessDesigner } from '@/components/SimpleProcessDesignerV2/src/';
|
||||
<script setup lang="ts">
|
||||
import { SimpleProcessDesigner } from '@/components/SimpleProcessDesignerV2/src/'
|
||||
import { getModel } from '@/api/bpm/model'
|
||||
import { getForm, FormVO } from '@/api/bpm/form'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
@ -15,9 +15,9 @@ defineOptions({
|
||||
name: 'SimpleWorkflowDesignEditor'
|
||||
})
|
||||
const { query } = useRoute() // 路由的查询
|
||||
const modelId : string | undefined = query.modelId as string;
|
||||
const modelId: string | undefined = query.modelId as string
|
||||
const formFields = ref<string[]>([])
|
||||
const formType = ref(20);
|
||||
const formType = ref(20)
|
||||
const roleOptions = ref<RoleApi.RoleVO[]>([]) // 角色列表
|
||||
const postOptions = ref<PostApi.PostVO[]>([]) // 岗位列表
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||
@ -32,28 +32,28 @@ provide('userList', userOptions)
|
||||
provide('deptList', deptOptions)
|
||||
provide('userGroupList', userGroupOptions)
|
||||
provide('deptTree', deptTreeOptions)
|
||||
onMounted( async () => {
|
||||
const bpmnModel = await getModel(modelId);
|
||||
onMounted(async () => {
|
||||
const bpmnModel = await getModel(modelId)
|
||||
if (bpmnModel) {
|
||||
formType.value = bpmnModel.formType
|
||||
if (formType.value === 10) {
|
||||
const bpmnForm = await getForm(bpmnModel.formId) as unknown as FormVO
|
||||
const bpmnForm = (await getForm(bpmnModel.formId)) as unknown as FormVO
|
||||
formFields.value = bpmnForm?.fields
|
||||
}
|
||||
}
|
||||
// 获得角色列表
|
||||
roleOptions.value = await RoleApi.getSimpleRoleList()
|
||||
// 获得岗位列表
|
||||
postOptions.value = await PostApi.getSimplePostList()
|
||||
// 获得用户列表
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
// 获得部门列表
|
||||
deptOptions.value = await DeptApi.getSimpleDeptList()
|
||||
|
||||
deptTreeOptions.value = handleTree(deptOptions.value as DeptApi.DeptVO[], 'id');
|
||||
deptTreeOptions.value = handleTree(deptOptions.value as DeptApi.DeptVO[], 'id')
|
||||
|
||||
// 用户组列表
|
||||
userGroupOptions.value = await UserGroupApi.getUserGroupSimpleList()
|
||||
})
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
Reference in New Issue
Block a user