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( 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

View File

@ -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>