feat: 发起流程页面-左侧分类列表只展示有流程的分类

This commit is contained in:
GoldenZqqq 2024-11-19 15:54:52 +08:00
parent 5f2e23f4da
commit caa31a67fe
2 changed files with 25 additions and 6 deletions

View File

@ -162,8 +162,10 @@ const getApprovalDetail = async (row: any) => {
startUserSelectTasks.value = data.activityNodes?.filter(
(node: ApprovalNodeInfo) => CandidateStrategy.START_USER_SELECT === node.candidateStrategy
)
for (const node of startUserSelectTasks.value) {
startUserSelectAssignees.value[node.id] = []
if (startUserSelectTasks.value?.length > 0) {
for (const node of startUserSelectTasks.value) {
startUserSelectAssignees.value[node.id] = []
}
}
// Timeline

View File

@ -22,7 +22,7 @@
<el-col :span="5">
<div class="flex flex-col">
<div
v-for="category in categoryList"
v-for="category in availableCategories"
:key="category.code"
class="flex items-center p-10px cursor-pointer text-14px rounded-md"
:class="categoryActive.code === category.code ? 'text-#3e7bff bg-#e8eeff' : ''"
@ -137,9 +137,11 @@ const getCategoryList = async () => {
try {
//
categoryList.value = await CategoryApi.getCategorySimpleList()
//
if (categoryList.value.length > 0) {
categoryActive.value = categoryList.value[0]
//
await nextTick()
//
if (availableCategories.value.length > 0) {
categoryActive.value = availableCategories.value[0]
}
} finally {
}
@ -261,6 +263,21 @@ const handleScroll = (e) => {
onMounted(() => {
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>
<style lang="scss" scoped>