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
Commit
9a233ab6
authored
Feb 12, 2025
by
smallNorthLee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 抽取sliceName方法,移除流程发布校验是否存在进行中的单据方法
parent
d0da7d67
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
39 deletions
+23
-39
src/api/bpm/model/index.ts
+1
-10
src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue
+2
-2
src/utils/index.ts
+15
-0
src/views/bpm/model/CategoryDraggableModel.vue
+3
-13
src/views/bpm/model/form/index.vue
+0
-5
src/views/bpm/processInstance/create/index.vue
+2
-9
No files found.
src/api/bpm/model/index.ts
View file @
9a233ab6
...
...
@@ -76,13 +76,4 @@ export const deployModel = async (id: number) => {
export
const
cleanModel
=
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
'/bpm/model/clean?id='
+
id
})
}
/**
* 查询当前流程实例下是否存在正在进行中的单据
* @param modelId 模型定义id
* @returns true/false
*/
export
const
getProcessInstance
=
async
(
modelId
:
string
)
=>
{
return
await
request
.
get
({
url
:
'/bpm/task/manager-list?modelId='
+
modelId
})
}
src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue
View file @
9a233ab6
...
...
@@ -25,7 +25,6 @@
<
script
setup
lang=
"ts"
>
import
SimpleProcessModel
from
'./SimpleProcessModel.vue'
import
{
updateBpmSimpleModel
,
getBpmSimpleModel
}
from
'@/api/bpm/simple'
import
{
SimpleFlowNode
,
NodeType
,
NodeId
,
NODE_DEFAULT_TEXT
}
from
'./consts'
import
{
getModel
}
from
'@/api/bpm/model'
import
{
getForm
,
FormVO
}
from
'@/api/bpm/form'
...
...
@@ -35,6 +34,7 @@ import * as DeptApi from '@/api/system/dept'
import
*
as
PostApi
from
'@/api/system/post'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
UserGroupApi
from
'@/api/bpm/userGroup'
import
{
BpmModelFormType
}
from
'@/utils/constants'
defineOptions
({
name
:
'SimpleProcessDesigner'
...
...
@@ -169,7 +169,7 @@ onMounted(async () => {
if
(
bpmnModel
)
{
formType
.
value
=
bpmnModel
.
formType
//fix 解决修改时流程模型时formId为空报错问题
if
(
formType
.
value
===
10
&&
bpmnModel
.
formId
)
{
if
(
formType
.
value
===
BpmModelFormType
.
CUSTOM
&&
bpmnModel
.
formId
)
{
const
bpmnForm
=
(
await
getForm
(
bpmnModel
.
formId
))
as
unknown
as
FormVO
formFields
.
value
=
bpmnForm
?.
fields
}
...
...
src/utils/index.ts
View file @
9a233ab6
...
...
@@ -449,3 +449,18 @@ export function jsonParse(str: string) {
return
''
}
}
/**
* 截取字符串
*
* @param name
* @param start
* @param end
*/
export
const
sliceName
=
(
name
:
string
,
start
:
number
,
end
:
number
)
=>
{
if
(
name
.
length
>
end
)
{
return
name
.
slice
(
start
,
end
)
}
return
name
}
src/views/bpm/model/CategoryDraggableModel.vue
View file @
9a233ab6
...
...
@@ -89,7 +89,7 @@
</el-tooltip>
<el-image
v-if=
"row.icon"
:src=
"row.icon"
class=
"h-38px w-38px mr-10px rounded"
/>
<div
v-else
class=
"flow-icon"
>
<span
style=
"font-size: 12px; color: #fff"
>
{{
sliceName
(
row
.
name
)
}}
</span>
<span
style=
"font-size: 12px; color: #fff"
>
{{
sliceName
(
row
.
name
,
0
,
2
)
}}
</span>
</div>
{{
row
.
name
}}
</div>
...
...
@@ -273,6 +273,7 @@ import { useAppStore } from '@/store/modules/app'
import
{
cloneDeep
,
isEqual
}
from
'lodash-es'
import
{
useTagsView
}
from
'@/hooks/web/useTagsView'
import
{
useDebounceFn
}
from
'@vueuse/core'
import
{
sliceName
}
from
'@/utils/index'
defineOptions
({
name
:
'BpmModel'
})
...
...
@@ -445,11 +446,7 @@ const handleChangeState = async (row: any) => {
/** 发布流程 */
const
handleDeploy
=
async
(
row
:
any
)
=>
{
try
{
//校验当前版本的流程下是否存在正在进行中的单据
const
res
=
await
ModelApi
.
getProcessInstance
(
row
.
id
)
if
(
res
)
{
await
message
.
confirm
(
'流程下存在进行中的单据,是否确认发布该流程?'
)
}
await
message
.
confirm
(
'是否确认发布该流程?'
)
// 发起部署
await
ModelApi
.
deployModel
(
row
.
id
)
message
.
success
(
t
(
'发布成功'
))
...
...
@@ -605,13 +602,6 @@ const openModelForm = async (type: string, id?: number) => {
}
}
// 处理显示的名称
const
sliceName
=
(
name
:
string
)
=>
{
if
(
name
.
length
>
2
)
{
return
name
.
slice
(
0
,
2
)
}
return
name
}
watchEffect
(()
=>
{
if
(
props
.
categoryInfo
?.
modelList
)
{
updateModeList
()
...
...
src/views/bpm/model/form/index.vue
View file @
9a233ab6
...
...
@@ -316,11 +316,6 @@ const handleDeploy = async () => {
if
(
!
formData
.
value
.
id
)
{
await
message
.
confirm
(
'是否确认发布该流程?'
)
}
//校验当前版本的流程下是否存在正在进行中的单据
const
res
=
await
ModelApi
.
getProcessInstance
(
formData
.
value
.
id
)
if
(
res
)
{
await
message
.
confirm
(
'流程下存在进行中的单据,是否确认发布该流程?'
)
}
// 校验所有步骤
await
validateAllSteps
()
...
...
src/views/bpm/processInstance/create/index.vue
View file @
9a233ab6
...
...
@@ -65,7 +65,7 @@
/>
<div
v-else
class=
"flow-icon"
>
<span
style=
"font-size: 12px; color: #fff"
>
{{
sliceName
(
definition
.
name
)
sliceName
(
definition
.
name
,
0
,
2
)
}}
</span>
</div>
<el-text
class=
"!ml-10px"
size=
"large"
>
{{
definition
.
name
}}
</el-text>
...
...
@@ -97,6 +97,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import
{
CategoryApi
,
CategoryVO
}
from
'@/api/bpm/category'
import
ProcessDefinitionDetail
from
'./ProcessDefinitionDetail.vue'
import
{
groupBy
}
from
'lodash-es'
import
{
sliceName
}
from
'@/utils/index'
defineOptions
({
name
:
'BpmProcessInstanceCreate'
})
...
...
@@ -284,14 +285,6 @@ const availableCategories = computed(() => {
)
})
// 处理显示的名称
const
sliceName
=
(
name
:
string
)
=>
{
if
(
name
.
length
>
2
)
{
return
name
.
slice
(
0
,
2
)
}
return
name
}
/** 初始化 */
onMounted
(()
=>
{
getList
()
...
...
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