mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-08 14:44:58 +08:00
feat: 发起流程页面-左侧分类列表只展示有流程的分类
This commit is contained in:
parent
5f2e23f4da
commit
caa31a67fe
@ -162,8 +162,10 @@ const getApprovalDetail = async (row: any) => {
|
|||||||
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
|
||||||
)
|
)
|
||||||
for (const node of startUserSelectTasks.value) {
|
if (startUserSelectTasks.value?.length > 0) {
|
||||||
startUserSelectAssignees.value[node.id] = []
|
for (const node of startUserSelectTasks.value) {
|
||||||
|
startUserSelectAssignees.value[node.id] = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取审批节点,显示 Timeline 的数据
|
// 获取审批节点,显示 Timeline 的数据
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div
|
<div
|
||||||
v-for="category in categoryList"
|
v-for="category in availableCategories"
|
||||||
:key="category.code"
|
:key="category.code"
|
||||||
class="flex items-center p-10px cursor-pointer text-14px rounded-md"
|
class="flex items-center p-10px cursor-pointer text-14px rounded-md"
|
||||||
:class="categoryActive.code === category.code ? 'text-#3e7bff bg-#e8eeff' : ''"
|
:class="categoryActive.code === category.code ? 'text-#3e7bff bg-#e8eeff' : ''"
|
||||||
@ -137,9 +137,11 @@ const getCategoryList = async () => {
|
|||||||
try {
|
try {
|
||||||
// 流程分类
|
// 流程分类
|
||||||
categoryList.value = await CategoryApi.getCategorySimpleList()
|
categoryList.value = await CategoryApi.getCategorySimpleList()
|
||||||
// 选中首个分类
|
// 等待流程定义数据加载完成后再设置默认选中分类
|
||||||
if (categoryList.value.length > 0) {
|
await nextTick()
|
||||||
categoryActive.value = categoryList.value[0]
|
// 选中第一个有流程的分类
|
||||||
|
if (availableCategories.value.length > 0) {
|
||||||
|
categoryActive.value = availableCategories.value[0]
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
}
|
}
|
||||||
@ -261,6 +263,21 @@ const handleScroll = (e) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** 过滤出有流程的分类列表 */
|
||||||
|
const availableCategories = computed(() => {
|
||||||
|
if (!categoryList.value?.length || !processDefinitionGroup.value) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取所有有流程的分类代码
|
||||||
|
const availableCategoryCodes = Object.keys(processDefinitionGroup.value)
|
||||||
|
|
||||||
|
// 过滤出有流程的分类
|
||||||
|
return categoryList.value.filter(category =>
|
||||||
|
availableCategoryCodes.includes(category.code)
|
||||||
|
)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user