Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
0d7d2cd1
authored
Feb 19, 2025
by
芋道源码
Committed by
Gitee
Feb 19, 2025
Browse files
Options
Browse Files
Download
Plain Diff
!700 fix: 修复流程预测功能
Merge pull request !700 from SamllNorth_Lee/fix/bpm
parents
1de17cad
ee8de081
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
15 deletions
+58
-15
src/api/bpm/processInstance/index.ts
+1
-1
src/components/SimpleProcessDesignerV2/src/consts.ts
+1
-0
src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
+16
-6
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
+1
-1
src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
+33
-7
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+6
-0
No files found.
src/api/bpm/processInstance/index.ts
View file @
0d7d2cd1
...
@@ -90,7 +90,7 @@ export const getProcessInstanceCopyPage = async (params: any) => {
...
@@ -90,7 +90,7 @@ export const getProcessInstanceCopyPage = async (params: any) => {
// 获取审批详情
// 获取审批详情
export
const
getApprovalDetail
=
async
(
params
:
any
)
=>
{
export
const
getApprovalDetail
=
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
'bpm/process-instance/get-approval-detail'
,
params
})
return
await
request
.
get
({
url
:
'
/
bpm/process-instance/get-approval-detail'
,
params
})
}
}
// 获取表单字段权限
// 获取表单字段权限
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
0d7d2cd1
...
@@ -532,6 +532,7 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
...
@@ -532,6 +532,7 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
{
label
:
'部门负责人'
,
value
:
CandidateStrategy
.
DEPT_LEADER
},
{
label
:
'部门负责人'
,
value
:
CandidateStrategy
.
DEPT_LEADER
},
{
label
:
'连续多级部门负责人'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'连续多级部门负责人'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'指定岗位'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'指定岗位'
,
value
:
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'发起人自选'
,
value
:
CandidateStrategy
.
START_USER_SELECT
},
{
label
:
'发起人本人'
,
value
:
CandidateStrategy
.
START_USER
},
{
label
:
'发起人本人'
,
value
:
CandidateStrategy
.
START_USER
},
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
...
...
src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
View file @
0d7d2cd1
...
@@ -188,12 +188,8 @@
...
@@ -188,12 +188,8 @@
:scroll=
"true"
:scroll=
"true"
max-height=
"600px"
max-height=
"600px"
>
>
<!-- append-to-body -->
<div>
<div
v-highlight
>
<pre><code
v-dompurify-html=
"highlightedCode(previewResult)"
class=
"hljs"
></code></pre>
<code
class=
"hljs"
>
<!-- 高亮代码块 -->
{{ previewResult }}
</code>
</div>
</div>
</Dialog>
</Dialog>
</div>
</div>
...
@@ -237,6 +233,8 @@ import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
...
@@ -237,6 +233,8 @@ import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
// const eventName = reactive({
// const eventName = reactive({
// name: ''
// name: ''
// })
// })
import
hljs
from
'highlight.js'
// 导入代码高亮文件
import
'highlight.js/styles/github.css'
// 导入代码高亮样式
defineOptions
({
name
:
'MyProcessDesigner'
})
defineOptions
({
name
:
'MyProcessDesigner'
})
...
@@ -308,6 +306,18 @@ const props = defineProps({
...
@@ -308,6 +306,18 @@ const props = defineProps({
}
}
})
})
/**
* 代码高亮
*/
const
highlightedCode
=
(
code
:
string
)
=>
{
// 高亮
if
(
previewType
.
value
===
'json'
)
{
code
=
JSON
.
stringify
(
code
,
null
,
2
)
}
const
result
=
hljs
.
highlight
(
code
,
{
language
:
previewType
.
value
,
ignoreIllegals
:
true
})
return
result
.
value
||
' '
}
provide
(
'configGlobal'
,
props
)
provide
(
'configGlobal'
,
props
)
let
bpmnModeler
:
any
=
null
let
bpmnModeler
:
any
=
null
const
defaultZoom
=
ref
(
1
)
const
defaultZoom
=
ref
(
1
)
...
...
src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
View file @
0d7d2cd1
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
</div>
</div>
<el-divider
content-position=
"left"
>
字段权限
</el-divider>
<el-divider
content-position=
"left"
>
字段权限
</el-divider>
<div
class=
"field-setting-pane"
v-if=
"formType ===
10
"
>
<div
class=
"field-setting-pane"
v-if=
"formType ===
BpmModelFormType.NORMAL
"
>
<div
class=
"field-permit-title"
>
<div
class=
"field-permit-title"
>
<div
class=
"setting-title-label first-title"
>
字段名称
</div>
<div
class=
"setting-title-label first-title"
>
字段名称
</div>
<div
class=
"other-titles"
>
<div
class=
"other-titles"
>
...
...
src/views/bpm/processInstance/create/ProcessDefinitionDetail.vue
View file @
0d7d2cd1
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
decodeFields
,
setConfAndFields2
}
from
'@/utils/formCreate'
import
{
decodeFields
,
setConfAndFields2
}
from
'@/utils/formCreate'
import
{
BpmModelType
}
from
'@/utils/constants'
import
{
BpmModelType
,
BpmModelFormType
}
from
'@/utils/constants'
import
{
import
{
CandidateStrategy
,
CandidateStrategy
,
NodeId
,
NodeId
,
...
@@ -108,6 +108,7 @@ const fApi = ref<ApiAttrs>()
...
@@ -108,6 +108,7 @@ const fApi = ref<ApiAttrs>()
// 指定审批人
// 指定审批人
const
startUserSelectTasks
:
any
=
ref
([])
// 发起人需要选择审批人或抄送人的任务列表
const
startUserSelectTasks
:
any
=
ref
([])
// 发起人需要选择审批人或抄送人的任务列表
const
startUserSelectAssignees
=
ref
({})
// 发起人选择审批人的数据
const
startUserSelectAssignees
=
ref
({})
// 发起人选择审批人的数据
const
hisStartUserSelectAssignees
=
ref
({})
// 历史发起人选择审批人的数据
const
bpmnXML
:
any
=
ref
(
null
)
// BPMN 数据
const
bpmnXML
:
any
=
ref
(
null
)
// BPMN 数据
const
simpleJson
=
ref
<
string
|
undefined
>
()
// Simple 设计器数据 json 格式
const
simpleJson
=
ref
<
string
|
undefined
>
()
// Simple 设计器数据 json 格式
...
@@ -121,7 +122,7 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
...
@@ -121,7 +122,7 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
startUserSelectAssignees
.
value
=
{}
startUserSelectAssignees
.
value
=
{}
// 情况一:流程表单
// 情况一:流程表单
if
(
row
.
formType
==
10
)
{
if
(
row
.
formType
==
BpmModelFormType
.
NORMAL
)
{
// 设置表单
// 设置表单
// 注意:需要从 formVariables 中,移除不在 row.formFields 的值。
// 注意:需要从 formVariables 中,移除不在 row.formFields 的值。
// 原因是:后端返回的 formVariables 里面,会有一些非表单的信息。例如说,某个流程节点的审批人。
// 原因是:后端返回的 formVariables 里面,会有一些非表单的信息。例如说,某个流程节点的审批人。
...
@@ -155,32 +156,57 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
...
@@ -155,32 +156,57 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
}
}
}
}
// 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次
watch
(
detailForm
.
value
,
(
newValue
)
=>
{
if
(
newValue
&&
Object
.
keys
(
newValue
.
value
).
length
>
0
)
{
//记录之前的节点审批人
hisStartUserSelectAssignees
.
value
=
startUserSelectAssignees
.
value
startUserSelectAssignees
.
value
=
{}
getApprovalDetail
({
id
:
props
.
selectProcessDefinition
.
id
,
processVariablesStr
:
newValue
.
value
})
}
},
{
immediate
:
true
}
)
/** 获取审批详情 */
/** 获取审批详情 */
const
getApprovalDetail
=
async
(
row
:
any
)
=>
{
const
getApprovalDetail
=
async
(
row
:
any
)
=>
{
try
{
try
{
// TODO 获取审批详情,设置 activityId 为发起人节点(为了获取字段权限。暂时只对 Simple 设计器有效)
// TODO 获取审批详情,设置 activityId 为发起人节点(为了获取字段权限。暂时只对 Simple 设计器有效)
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
({
const
data
=
await
ProcessInstanceApi
.
getApprovalDetail
({
processDefinitionId
:
row
.
id
,
processDefinitionId
:
row
.
id
,
activityId
:
NodeId
.
START_USER_NODE_ID
activityId
:
NodeId
.
START_USER_NODE_ID
,
processVariablesStr
:
JSON
.
stringify
(
row
.
processVariablesStr
)
})
})
if
(
!
data
)
{
if
(
!
data
)
{
message
.
error
(
'查询不到审批详情信息!'
)
message
.
error
(
'查询不到审批详情信息!'
)
return
return
}
}
// 获取审批节点,显示 Timeline 的数据
activityNodes
.
value
=
data
.
activityNodes
// 获取发起人自选的任务
// 获取发起人自选的任务
startUserSelectTasks
.
value
=
data
.
activityNodes
?.
filter
(
startUserSelectTasks
.
value
=
data
.
activityNodes
?.
filter
(
(
node
:
ApprovalNodeInfo
)
=>
CandidateStrategy
.
START_USER_SELECT
===
node
.
candidateStrategy
(
node
:
ApprovalNodeInfo
)
=>
CandidateStrategy
.
START_USER_SELECT
===
node
.
candidateStrategy
)
)
if
(
startUserSelectTasks
.
value
?.
length
>
0
)
{
if
(
startUserSelectTasks
.
value
?.
length
>
0
)
{
for
(
const
node
of
startUserSelectTasks
.
value
)
{
for
(
const
node
of
startUserSelectTasks
.
value
)
{
startUserSelectAssignees
.
value
[
node
.
id
]
=
[]
if
(
hisStartUserSelectAssignees
.
value
[
node
.
id
]
&&
hisStartUserSelectAssignees
.
value
[
node
.
id
].
length
>
0
)
{
startUserSelectAssignees
.
value
[
node
.
id
]
=
hisStartUserSelectAssignees
.
value
[
node
.
id
]
}
else
{
startUserSelectAssignees
.
value
[
node
.
id
]
=
[]
}
}
}
}
}
// 获取审批节点,显示 Timeline 的数据
activityNodes
.
value
=
data
.
activityNodes
// 获取表单字段权限
// 获取表单字段权限
const
formFieldsPermission
=
data
.
formFieldsPermission
const
formFieldsPermission
=
data
.
formFieldsPermission
// 设置表单字段权限
// 设置表单字段权限
...
...
src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
View file @
0d7d2cd1
...
@@ -703,6 +703,12 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
...
@@ -703,6 +703,12 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
// 校验表单
// 校验表单
if
(
!
formRef
)
return
if
(
!
formRef
)
return
await
formRef
.
validate
()
await
formRef
.
validate
()
//校验流程表单必填字段
const
valid
=
await
validateNormalForm
()
if
(
!
valid
)
{
message
.
warning
(
'表单校验不通过,请先完善表单!!'
)
return
}
if
(
pass
)
{
if
(
pass
)
{
// 获取修改的流程变量, 暂时只支持流程表单
// 获取修改的流程变量, 暂时只支持流程表单
const
variables
=
getUpdatedProcessInstanceVariables
()
const
variables
=
getUpdatedProcessInstanceVariables
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment