Skip to content

Commit f1ac8ba

Browse files
committed
Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
2 parents 89c3af5 + baa4116 commit f1ac8ba

File tree

6 files changed

+15
-29
lines changed

6 files changed

+15
-29
lines changed

src/components/SimpleProcessDesignerV2/src/node.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { cloneDeep } from 'lodash-es'
21
import { TaskStatusEnum } from '@/api/bpm/task'
32
import * as RoleApi from '@/api/system/role'
43
import * as DeptApi from '@/api/system/dept'
@@ -47,9 +46,9 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
4746
// 字段权限配置. 需要有 field, title, permissioin 属性
4847
const fieldsPermissionConfig = ref<Array<Record<string, any>>>([])
4948

50-
const formType = inject<Ref<number>>('formType') // 表单类型
49+
const formType = inject<Ref<number|undefined>>('formType', ref()) // 表单类型
5150

52-
const formFields = inject<Ref<string[]>>('formFields') // 流程表单字段
51+
const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段
5352

5453
const getNodeConfigFormFields = (nodeFormFields?: Array<Record<string, string>>) => {
5554
nodeFormFields = toRaw(nodeFormFields)
@@ -170,13 +169,13 @@ export type CopyTaskFormType = {
170169
* @description 节点表单数据。 用于审批节点、抄送节点
171170
*/
172171
export function useNodeForm(nodeType: NodeType) {
173-
const roleOptions = inject<Ref<RoleApi.RoleVO[]>>('roleList') // 角色列表
174-
const postOptions = inject<Ref<PostApi.PostVO[]>>('postList') // 岗位列表
175-
const userOptions = inject<Ref<UserApi.UserVO[]>>('userList') // 用户列表
176-
const deptOptions = inject<Ref<DeptApi.DeptVO[]>>('deptList') // 部门列表
177-
const userGroupOptions = inject<Ref<UserGroupApi.UserGroupVO[]>>('userGroupList') // 用户组列表
178-
const deptTreeOptions = inject('deptTree') // 部门树
179-
const formFields = inject<Ref<string[]>>('formFields') // 流程表单字段
172+
const roleOptions = inject<Ref<RoleApi.RoleVO[]>>('roleList', ref([])) // 角色列表
173+
const postOptions = inject<Ref<PostApi.PostVO[]>>('postList', ref([])) // 岗位列表
174+
const userOptions = inject<Ref<UserApi.UserVO[]>>('userList', ref([])) // 用户列表
175+
const deptOptions = inject<Ref<DeptApi.DeptVO[]>>('deptList', ref([])) // 部门列表
176+
const userGroupOptions = inject<Ref<UserGroupApi.UserGroupVO[]>>('userGroupList',ref([])) // 用户组列表
177+
const deptTreeOptions = inject('deptTree', ref()) // 部门树
178+
const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段
180179
const configForm = ref<UserTaskFormType | CopyTaskFormType>()
181180
if (nodeType === NodeType.USER_TASK_NODE) {
182181
configForm.value = {

src/components/SimpleProcessDesignerV2/src/nodes/EndEventNode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const props = defineProps({
7777
const currentNode = useWatchNode(props)
7878
// 是否只读
7979
const readonly = inject<Boolean>('readonly')
80-
const processInstance = inject<Ref<any>>('processInstance')
80+
const processInstance = inject<Ref<any>>('processInstance', ref({}))
8181
// 审批信息的弹窗显示,用于只读模式
8282
const dialogVisible = ref(false) // 弹窗可见性
8383
const processInstanceInfos = ref<any[]>([]) // 流程的审批信息

src/components/SimpleProcessDesignerV2/src/nodes/StartUserNode.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
><span class="iconfont icon-start-user"></span
1414
></div>
1515
<input
16-
v-if="showInput"
16+
v-if="!readonly && showInput"
1717
type="text"
1818
class="editable-title-input"
1919
@blur="blurEvent()"
@@ -117,7 +117,7 @@ const props = defineProps({
117117
}
118118
})
119119
const readonly = inject<Boolean>('readonly') // 是否只读
120-
const tasks = inject<Ref<any[]>>('tasks')
120+
const tasks = inject<Ref<any[]>>('tasks', ref([]))
121121
// 定义事件,更新父组件。
122122
const emits = defineEmits<{
123123
'update:modelValue': [node: SimpleFlowNode | undefined]

src/components/SimpleProcessDesignerV2/src/nodes/UserTaskNode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const emits = defineEmits<{
131131
132132
// 是否只读
133133
const readonly = inject<Boolean>('readonly')
134-
const tasks = inject<Ref<any[]>>('tasks')
134+
const tasks = inject<Ref<any[]>>('tasks', ref([]))
135135
// 监控节点变化
136136
const currentNode = useWatchNode(props)
137137
// 节点名称编辑

src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
:flow-node="simpleModel"
55
:tasks="tasks"
66
:process-instance="processInstance"
7-
class="process-viewer"
87
/>
98
</div>
109
</template>
@@ -20,7 +19,7 @@ const props = defineProps({
2019
modelView: propTypes.object,
2120
simpleJson: propTypes.string // Simple 模型结构数据 (json 格式)
2221
})
23-
const simpleModel = ref()
22+
const simpleModel = ref<any>({})
2423
// 用户任务
2524
const tasks = ref([])
2625
// 流程实例
@@ -161,15 +160,4 @@ const setSimpleModelNodeTaskStatus = (
161160
</script>
162161

163162
<style lang="scss" scoped>
164-
.process-viewer-container {
165-
width: 100%;
166-
height: 100%;
167-
168-
:deep(.process-viewer) {
169-
width: 100%;
170-
height: 100% !important;
171-
min-height: 100%;
172-
overflow: auto;
173-
}
174-
}
175163
</style>

src/views/bpm/simple/SimpleModelDesign.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const props = defineProps<{
2323
modelId?: string
2424
modelKey?: string
2525
modelName?: string
26-
value?: string
26+
value?: any
2727
startUserIds?: number[]
2828
}>()
2929
@@ -34,7 +34,6 @@ const currentValue = ref('')
3434
3535
// 初始化或更新当前值
3636
const initOrUpdateValue = async () => {
37-
console.log('initOrUpdateValue', props.value)
3837
if (props.value) {
3938
currentValue.value = props.value
4039
// 如果设计器已经初始化,立即加载数据

0 commit comments

Comments
 (0)