fix: 发起流程页面-修复右侧分类名称都为null的bug

pull/582/head
GoldenZqqq 2024-11-08 13:21:57 +08:00
parent 0fae9a4ba4
commit 1e6762ea69
1 changed files with 13 additions and 6 deletions

View File

@ -36,11 +36,13 @@
<el-scrollbar ref="scrollWrapper" height="700">
<div
class="mb-20px pl-10px"
v-for="(definitions, title) in processDefinitionGroup"
:key="title"
:ref="`category-${title}`"
v-for="(definitions, categoryCode) in processDefinitionGroup"
:key="categoryCode"
:ref="`category-${categoryCode}`"
>
<h3 class="text-18px font-bold mb-10px mt-5px">{{ title }}</h3>
<h3 class="text-18px font-bold mb-10px mt-5px">
{{ getCategoryName(categoryCode) }}
</h3>
<div class="grid grid-cols-3 gap3">
<el-tooltip
v-for="definition in definitions"
@ -170,7 +172,7 @@ const handleQuery = () => {
//
const processDefinitionGroup: any = computed(() => {
if (!processDefinitionList.value?.length) return {}
return groupBy(filteredProcessDefinitionList.value, 'categoryName')
return groupBy(filteredProcessDefinitionList.value, 'category')
})
// ========== ==========
@ -188,7 +190,7 @@ const handleSelect = async (row, formVariables?) => {
//
const handleCategoryClick = (category) => {
categoryActive.value = category
const categoryRef = proxy.$refs[`category-${category.name}`] // DOM
const categoryRef = proxy.$refs[`category-${category.code}`] // DOM
if (categoryRef?.length) {
const scrollWrapper = proxy.$refs.scrollWrapper //
const categoryOffsetTop = categoryRef[0].offsetTop
@ -198,6 +200,11 @@ const handleCategoryClick = (category) => {
}
}
// code
const getCategoryName = (categoryCode) => {
return categoryList.value?.find((ctg) => ctg.code === categoryCode)?.name
}
/** 初始化 */
onMounted(() => {
getList()