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
708e12b6
authored
Oct 16, 2024
by
GoldenZqqq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化交互细节、删除流程分类接口联调
parent
91ea4b79
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
src/views/bpm/model/CategoryDraggableModel.vue
+21
-5
src/views/bpm/model/index_new.vue
+6
-7
No files found.
src/views/bpm/model/CategoryDraggableModel.vue
View file @
708e12b6
<
template
>
<
template
>
<!-- 默认使其全部展开 -->
<!-- 默认使其全部展开 -->
<el-collapse
v-model=
"activeCollapse"
>
<el-collapse
v-model=
"activeCollapse"
>
<el-collapse-item
:name=
"categoryInfo.id"
>
<el-collapse-item
:name=
"categoryInfo.id"
:disabled=
"categoryInfo.modelList.length === 0"
>
<template
#
icon=
"
{ isActive }">
<template
#
icon=
"
{ isActive }">
<div
class=
"flex-1 flex"
v-if=
"!isCategorySorting"
>
<div
class=
"flex-1 flex"
v-if=
"!isCategorySorting"
>
<div
<div
v-if=
"categoryInfo.modelList.length > 0"
class=
"ml-20px flex items-center"
class=
"ml-20px flex items-center"
:class=
"['transition-transform duration-300', isActive ? 'rotate-180' : 'rotate-0']"
:class=
"['transition-transform duration-300', isActive ? 'rotate-180' : 'rotate-0']"
>
>
...
@@ -230,6 +231,7 @@
...
@@ -230,6 +231,7 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
CategoryApi
}
from
'@/api/bpm/category'
import
Sortable
from
'sortablejs'
import
Sortable
from
'sortablejs'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
...
@@ -409,8 +411,7 @@ const handleSort = () => {
...
@@ -409,8 +411,7 @@ const handleSort = () => {
}
}
const
saveSort
=
()
=>
{
const
saveSort
=
()
=>
{
// 接口调用
// TODO 芋艿:这里需要一个保存分类下模型排序接口
console
.
log
(
tableData
.
value
)
// 刷新列表
// 刷新列表
emit
(
'success'
)
emit
(
'success'
)
isModelSorting
.
value
=
false
isModelSorting
.
value
=
false
...
@@ -451,6 +452,9 @@ const initSort = () => {
...
@@ -451,6 +452,9 @@ const initSort = () => {
// 更新表格数据
// 更新表格数据
const
updateTableData
=
()
=>
{
const
updateTableData
=
()
=>
{
tableData
.
value
=
cloneDeep
(
props
.
categoryInfo
.
modelList
)
tableData
.
value
=
cloneDeep
(
props
.
categoryInfo
.
modelList
)
if
(
props
.
categoryInfo
.
modelList
.
length
>
0
)
{
activeCollapse
.
value
=
[
props
.
categoryInfo
.
id
]
}
}
}
const
renameVal
=
ref
(
''
)
const
renameVal
=
ref
(
''
)
...
@@ -463,15 +467,27 @@ const handleRenameConfirm = () => {
...
@@ -463,15 +467,27 @@ const handleRenameConfirm = () => {
// 删除分类
// 删除分类
const
handleDeleteGroup
=
async
()
=>
{
const
handleDeleteGroup
=
async
()
=>
{
try
{
if
(
props
.
categoryInfo
.
modelList
.
length
>
0
)
{
if
(
props
.
categoryInfo
.
modelList
.
length
>
0
)
{
return
message
.
warning
(
'该分类下仍有流程定义,不允许删除'
)
return
message
.
warning
(
'该分类下仍有流程定义,不允许删除'
)
}
}
await
message
.
confirm
(
'确认删除分类吗?'
)
await
message
.
confirm
(
'确认删除分类吗?'
)
// 实际调用接口删除
// 发起删除
await
CategoryApi
.
deleteCategory
(
props
.
categoryInfo
.
id
)
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
emit
(
'success'
)
}
catch
{}
}
}
watch
(()
=>
props
.
categoryInfo
.
modelList
,
updateTableData
,
{
immediate
:
true
})
watch
(()
=>
props
.
categoryInfo
.
modelList
,
updateTableData
,
{
immediate
:
true
})
watch
(
()
=>
props
.
isCategorySorting
,
(
val
)
=>
{
if
(
val
)
activeCollapse
.
value
=
[]
},
{
immediate
:
true
}
)
defineExpose
({
defineExpose
({
activeCollapse
activeCollapse
})
})
...
...
src/views/bpm/model/index_new.vue
View file @
708e12b6
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
ref=
"categoryDraggableModelRef"
ref=
"categoryDraggableModelRef"
:isCategorySorting=
"isCategorySorting"
:isCategorySorting=
"isCategorySorting"
:categoryInfo=
"element"
:categoryInfo=
"element"
@
success=
"get
AllModel
"
@
success=
"get
List
"
/>
/>
</ContentWrap>
</ContentWrap>
</
template
>
</
template
>
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
</ContentWrap>
</ContentWrap>
<!-- 表单弹窗:添加/修改流程 -->
<!-- 表单弹窗:添加/修改流程 -->
<ModelForm
ref=
"formRef"
@
success=
"get
AllModel
"
/>
<ModelForm
ref=
"formRef"
@
success=
"get
List
"
/>
<!-- 表单弹窗:添加/修改分类 -->
<!-- 表单弹窗:添加/修改分类 -->
<CategoryForm
ref=
"categoryFormRef"
@
success=
"getList"
/>
<CategoryForm
ref=
"categoryFormRef"
@
success=
"getList"
/>
<!-- 弹窗:表单详情 -->
<!-- 弹窗:表单详情 -->
...
@@ -133,7 +133,7 @@ const getAllModel = async () => {
...
@@ -133,7 +133,7 @@ const getAllModel = async () => {
/** 搜索按钮操作 */
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
const
handleQuery
=
()
=>
{
queryParams
.
pageNo
=
1
queryParams
.
pageNo
=
1
get
AllModel
()
get
List
()
}
}
/** 添加/修改操作 */
/** 添加/修改操作 */
...
@@ -171,9 +171,6 @@ const handleSort = () => {
...
@@ -171,9 +171,6 @@ const handleSort = () => {
// 保存初始数据
// 保存初始数据
originalData
.
value
=
cloneDeep
(
categoryGroup
.
value
)
originalData
.
value
=
cloneDeep
(
categoryGroup
.
value
)
isCategorySorting
.
value
=
true
isCategorySorting
.
value
=
true
categoryDraggableModelRef
.
value
?.
forEach
((
element
)
=>
{
element
.
activeCollapse
=
[]
})
}
}
// 取消排序
// 取消排序
const
cancelSort
=
()
=>
{
const
cancelSort
=
()
=>
{
...
@@ -182,7 +179,9 @@ const cancelSort = () => {
...
@@ -182,7 +179,9 @@ const cancelSort = () => {
isCategorySorting
.
value
=
false
isCategorySorting
.
value
=
false
}
}
// 保存排序
// 保存排序
const
saveSort
=
()
=>
{}
const
saveSort
=
()
=>
{
// TODO 芋艿:这里需要一个保存分类排序接口
}
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
...
...
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