36
36
<el-scrollbar ref =" scrollWrapper" height =" 700" >
37
37
<div
38
38
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 }`"
42
42
>
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 >
44
46
<div class =" grid grid-cols-3 gap3" >
45
47
<el-tooltip
46
48
v-for =" definition in definitions"
@@ -170,7 +172,7 @@ const handleQuery = () => {
170
172
// 流程定义的分组
171
173
const processDefinitionGroup: any = computed (() => {
172
174
if (! processDefinitionList .value ?.length ) return {}
173
- return groupBy (filteredProcessDefinitionList .value , ' categoryName ' )
175
+ return groupBy (filteredProcessDefinitionList .value , ' category ' )
174
176
})
175
177
176
178
// ========== 表单相关 ==========
@@ -188,7 +190,7 @@ const handleSelect = async (row, formVariables?) => {
188
190
// 左侧分类切换
189
191
const handleCategoryClick = (category ) => {
190
192
categoryActive .value = category
191
- const categoryRef = proxy .$refs [` category-${category .name } ` ] // 获取点击分类对应的 DOM 元素
193
+ const categoryRef = proxy .$refs [` category-${category .code } ` ] // 获取点击分类对应的 DOM 元素
192
194
if (categoryRef ?.length ) {
193
195
const scrollWrapper = proxy .$refs .scrollWrapper // 获取右侧滚动容器
194
196
const categoryOffsetTop = categoryRef [0 ].offsetTop
@@ -198,6 +200,11 @@ const handleCategoryClick = (category) => {
198
200
}
199
201
}
200
202
203
+ // 通过分类code获取对应的名称
204
+ const getCategoryName = (categoryCode ) => {
205
+ return categoryList .value ?.find ((ctg ) => ctg .code === categoryCode )?.name
206
+ }
207
+
201
208
/** 初始化 */
202
209
onMounted (() => {
203
210
getList ()
0 commit comments