【功能完善】工作流:详情优化

pull/594/head
YunaiV 2024-11-21 19:48:09 +08:00
parent 3a9f8db3fa
commit 24e1374993
1 changed files with 16 additions and 14 deletions

View File

@ -85,7 +85,7 @@
<script lang="ts" setup>
import * as DefinitionApi from '@/api/bpm/definition'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { CategoryApi } from '@/api/bpm/category'
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
import { groupBy } from 'lodash-es'
@ -221,14 +221,14 @@ const handleSelect = async (row, formVariables?) => {
processDefinitionDetailRef.value?.initProcessInfo(row, formVariables)
}
/** 处理滚动事件 */
const handleScroll = (e) => {
/** 处理滚动事件,和左侧分类联动 */
const handleScroll = (e: any) => {
// 使
const scrollTop = e.scrollTop
//
const categoryPositions = categoryList.value
.map((category) => {
.map((category: CategoryVO) => {
const categoryRef = proxy.$refs[`category-${category.code}`]
if (categoryRef?.[0]) {
return {
@ -254,29 +254,31 @@ const handleScroll = (e) => {
// active
if (currentCategory && categoryActive.value.code !== currentCategory.code) {
categoryActive.value = categoryList.value.find((c) => c.code === currentCategory.code)
categoryActive.value = categoryList.value.find(
(c: CategoryVO) => c.code === currentCategory.code
)
}
}
/** 初始化 */
onMounted(() => {
getList()
})
/** 过滤出有流程的分类列表 */
/** 过滤出有流程的分类列表。目的:只展示有流程的分类 */
const availableCategories = computed(() => {
if (!categoryList.value?.length || !processDefinitionGroup.value) {
return []
}
//
const availableCategoryCodes = Object.keys(processDefinitionGroup.value)
//
return categoryList.value.filter(category =>
return categoryList.value.filter((category: CategoryVO) =>
availableCategoryCodes.includes(category.code)
)
})
/** 初始化 */
onMounted(() => {
getList()
})
</script>
<style lang="scss" scoped>