Skip to content

Commit d052356

Browse files
authored
Merge pull request #100 from GoldenZqqq/feature/bpm
发起流程页面-修复右侧分类名称都为null的bug
2 parents 0fae9a4 + 1e6762e commit d052356

File tree

1 file changed

+13
-6
lines changed
  • src/views/bpm/processInstance/create

1 file changed

+13
-6
lines changed

src/views/bpm/processInstance/create/index.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
<el-scrollbar ref="scrollWrapper" height="700">
3737
<div
3838
class="mb-20px pl-10px"
39-
v-for="(definitions, title) in processDefinitionGroup"
40-
:key="title"
41-
:ref="`category-${title}`"
39+
v-for="(definitions, categoryCode) in processDefinitionGroup"
40+
:key="categoryCode"
41+
:ref="`category-${categoryCode}`"
4242
>
43-
<h3 class="text-18px font-bold mb-10px mt-5px">{{ title }}</h3>
43+
<h3 class="text-18px font-bold mb-10px mt-5px">
44+
{{ getCategoryName(categoryCode) }}
45+
</h3>
4446
<div class="grid grid-cols-3 gap3">
4547
<el-tooltip
4648
v-for="definition in definitions"
@@ -170,7 +172,7 @@ const handleQuery = () => {
170172
// 流程定义的分组
171173
const processDefinitionGroup: any = computed(() => {
172174
if (!processDefinitionList.value?.length) return {}
173-
return groupBy(filteredProcessDefinitionList.value, 'categoryName')
175+
return groupBy(filteredProcessDefinitionList.value, 'category')
174176
})
175177
176178
// ========== 表单相关 ==========
@@ -188,7 +190,7 @@ const handleSelect = async (row, formVariables?) => {
188190
// 左侧分类切换
189191
const handleCategoryClick = (category) => {
190192
categoryActive.value = category
191-
const categoryRef = proxy.$refs[`category-${category.name}`] // 获取点击分类对应的 DOM 元素
193+
const categoryRef = proxy.$refs[`category-${category.code}`] // 获取点击分类对应的 DOM 元素
192194
if (categoryRef?.length) {
193195
const scrollWrapper = proxy.$refs.scrollWrapper // 获取右侧滚动容器
194196
const categoryOffsetTop = categoryRef[0].offsetTop
@@ -198,6 +200,11 @@ const handleCategoryClick = (category) => {
198200
}
199201
}
200202
203+
// 通过分类code获取对应的名称
204+
const getCategoryName = (categoryCode) => {
205+
return categoryList.value?.find((ctg) => ctg.code === categoryCode)?.name
206+
}
207+
201208
/** 初始化 */
202209
onMounted(() => {
203210
getList()

0 commit comments

Comments
 (0)