Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
commit
f1ac8ba622
|
@ -1,4 +1,3 @@
|
||||||
import { cloneDeep } from 'lodash-es'
|
|
||||||
import { TaskStatusEnum } from '@/api/bpm/task'
|
import { TaskStatusEnum } from '@/api/bpm/task'
|
||||||
import * as RoleApi from '@/api/system/role'
|
import * as RoleApi from '@/api/system/role'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
@ -47,9 +46,9 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
|
||||||
// 字段权限配置. 需要有 field, title, permissioin 属性
|
// 字段权限配置. 需要有 field, title, permissioin 属性
|
||||||
const fieldsPermissionConfig = ref<Array<Record<string, any>>>([])
|
const fieldsPermissionConfig = ref<Array<Record<string, any>>>([])
|
||||||
|
|
||||||
const formType = inject<Ref<number>>('formType') // 表单类型
|
const formType = inject<Ref<number|undefined>>('formType', ref()) // 表单类型
|
||||||
|
|
||||||
const formFields = inject<Ref<string[]>>('formFields') // 流程表单字段
|
const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段
|
||||||
|
|
||||||
const getNodeConfigFormFields = (nodeFormFields?: Array<Record<string, string>>) => {
|
const getNodeConfigFormFields = (nodeFormFields?: Array<Record<string, string>>) => {
|
||||||
nodeFormFields = toRaw(nodeFormFields)
|
nodeFormFields = toRaw(nodeFormFields)
|
||||||
|
@ -170,13 +169,13 @@ export type CopyTaskFormType = {
|
||||||
* @description 节点表单数据。 用于审批节点、抄送节点
|
* @description 节点表单数据。 用于审批节点、抄送节点
|
||||||
*/
|
*/
|
||||||
export function useNodeForm(nodeType: NodeType) {
|
export function useNodeForm(nodeType: NodeType) {
|
||||||
const roleOptions = inject<Ref<RoleApi.RoleVO[]>>('roleList') // 角色列表
|
const roleOptions = inject<Ref<RoleApi.RoleVO[]>>('roleList', ref([])) // 角色列表
|
||||||
const postOptions = inject<Ref<PostApi.PostVO[]>>('postList') // 岗位列表
|
const postOptions = inject<Ref<PostApi.PostVO[]>>('postList', ref([])) // 岗位列表
|
||||||
const userOptions = inject<Ref<UserApi.UserVO[]>>('userList') // 用户列表
|
const userOptions = inject<Ref<UserApi.UserVO[]>>('userList', ref([])) // 用户列表
|
||||||
const deptOptions = inject<Ref<DeptApi.DeptVO[]>>('deptList') // 部门列表
|
const deptOptions = inject<Ref<DeptApi.DeptVO[]>>('deptList', ref([])) // 部门列表
|
||||||
const userGroupOptions = inject<Ref<UserGroupApi.UserGroupVO[]>>('userGroupList') // 用户组列表
|
const userGroupOptions = inject<Ref<UserGroupApi.UserGroupVO[]>>('userGroupList',ref([])) // 用户组列表
|
||||||
const deptTreeOptions = inject('deptTree') // 部门树
|
const deptTreeOptions = inject('deptTree', ref()) // 部门树
|
||||||
const formFields = inject<Ref<string[]>>('formFields') // 流程表单字段
|
const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段
|
||||||
const configForm = ref<UserTaskFormType | CopyTaskFormType>()
|
const configForm = ref<UserTaskFormType | CopyTaskFormType>()
|
||||||
if (nodeType === NodeType.USER_TASK_NODE) {
|
if (nodeType === NodeType.USER_TASK_NODE) {
|
||||||
configForm.value = {
|
configForm.value = {
|
||||||
|
|
|
@ -77,7 +77,7 @@ const props = defineProps({
|
||||||
const currentNode = useWatchNode(props)
|
const currentNode = useWatchNode(props)
|
||||||
// 是否只读
|
// 是否只读
|
||||||
const readonly = inject<Boolean>('readonly')
|
const readonly = inject<Boolean>('readonly')
|
||||||
const processInstance = inject<Ref<any>>('processInstance')
|
const processInstance = inject<Ref<any>>('processInstance', ref({}))
|
||||||
// 审批信息的弹窗显示,用于只读模式
|
// 审批信息的弹窗显示,用于只读模式
|
||||||
const dialogVisible = ref(false) // 弹窗可见性
|
const dialogVisible = ref(false) // 弹窗可见性
|
||||||
const processInstanceInfos = ref<any[]>([]) // 流程的审批信息
|
const processInstanceInfos = ref<any[]>([]) // 流程的审批信息
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
><span class="iconfont icon-start-user"></span
|
><span class="iconfont icon-start-user"></span
|
||||||
></div>
|
></div>
|
||||||
<input
|
<input
|
||||||
v-if="showInput"
|
v-if="!readonly && showInput"
|
||||||
type="text"
|
type="text"
|
||||||
class="editable-title-input"
|
class="editable-title-input"
|
||||||
@blur="blurEvent()"
|
@blur="blurEvent()"
|
||||||
|
@ -117,7 +117,7 @@ const props = defineProps({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const readonly = inject<Boolean>('readonly') // 是否只读
|
const readonly = inject<Boolean>('readonly') // 是否只读
|
||||||
const tasks = inject<Ref<any[]>>('tasks')
|
const tasks = inject<Ref<any[]>>('tasks', ref([]))
|
||||||
// 定义事件,更新父组件。
|
// 定义事件,更新父组件。
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
'update:modelValue': [node: SimpleFlowNode | undefined]
|
'update:modelValue': [node: SimpleFlowNode | undefined]
|
||||||
|
|
|
@ -131,7 +131,7 @@ const emits = defineEmits<{
|
||||||
|
|
||||||
// 是否只读
|
// 是否只读
|
||||||
const readonly = inject<Boolean>('readonly')
|
const readonly = inject<Boolean>('readonly')
|
||||||
const tasks = inject<Ref<any[]>>('tasks')
|
const tasks = inject<Ref<any[]>>('tasks', ref([]))
|
||||||
// 监控节点变化
|
// 监控节点变化
|
||||||
const currentNode = useWatchNode(props)
|
const currentNode = useWatchNode(props)
|
||||||
// 节点名称编辑
|
// 节点名称编辑
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
:flow-node="simpleModel"
|
:flow-node="simpleModel"
|
||||||
:tasks="tasks"
|
:tasks="tasks"
|
||||||
:process-instance="processInstance"
|
:process-instance="processInstance"
|
||||||
class="process-viewer"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -20,7 +19,7 @@ const props = defineProps({
|
||||||
modelView: propTypes.object,
|
modelView: propTypes.object,
|
||||||
simpleJson: propTypes.string // Simple 模型结构数据 (json 格式)
|
simpleJson: propTypes.string // Simple 模型结构数据 (json 格式)
|
||||||
})
|
})
|
||||||
const simpleModel = ref()
|
const simpleModel = ref<any>({})
|
||||||
// 用户任务
|
// 用户任务
|
||||||
const tasks = ref([])
|
const tasks = ref([])
|
||||||
// 流程实例
|
// 流程实例
|
||||||
|
@ -161,15 +160,4 @@ const setSimpleModelNodeTaskStatus = (
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.process-viewer-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
:deep(.process-viewer) {
|
|
||||||
width: 100%;
|
|
||||||
height: 100% !important;
|
|
||||||
min-height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -23,7 +23,7 @@ const props = defineProps<{
|
||||||
modelId?: string
|
modelId?: string
|
||||||
modelKey?: string
|
modelKey?: string
|
||||||
modelName?: string
|
modelName?: string
|
||||||
value?: string
|
value?: any
|
||||||
startUserIds?: number[]
|
startUserIds?: number[]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ const currentValue = ref('')
|
||||||
|
|
||||||
// 初始化或更新当前值
|
// 初始化或更新当前值
|
||||||
const initOrUpdateValue = async () => {
|
const initOrUpdateValue = async () => {
|
||||||
console.log('initOrUpdateValue', props.value)
|
|
||||||
if (props.value) {
|
if (props.value) {
|
||||||
currentValue.value = props.value
|
currentValue.value = props.value
|
||||||
// 如果设计器已经初始化,立即加载数据
|
// 如果设计器已经初始化,立即加载数据
|
||||||
|
|
Loading…
Reference in New Issue