【功能完善】工作流:详情优化
parent
3a9f8db3fa
commit
24e1374993
|
@ -85,7 +85,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as DefinitionApi from '@/api/bpm/definition'
|
import * as DefinitionApi from '@/api/bpm/definition'
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
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 ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
|
||||||
import { groupBy } from 'lodash-es'
|
import { groupBy } from 'lodash-es'
|
||||||
|
|
||||||
|
@ -221,14 +221,14 @@ const handleSelect = async (row, formVariables?) => {
|
||||||
processDefinitionDetailRef.value?.initProcessInfo(row, formVariables)
|
processDefinitionDetailRef.value?.initProcessInfo(row, formVariables)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理滚动事件 */
|
/** 处理滚动事件,和左侧分类联动 */
|
||||||
const handleScroll = (e) => {
|
const handleScroll = (e: any) => {
|
||||||
// 直接使用事件对象获取滚动位置
|
// 直接使用事件对象获取滚动位置
|
||||||
const scrollTop = e.scrollTop
|
const scrollTop = e.scrollTop
|
||||||
|
|
||||||
// 获取所有分类区域的位置信息
|
// 获取所有分类区域的位置信息
|
||||||
const categoryPositions = categoryList.value
|
const categoryPositions = categoryList.value
|
||||||
.map((category) => {
|
.map((category: CategoryVO) => {
|
||||||
const categoryRef = proxy.$refs[`category-${category.code}`]
|
const categoryRef = proxy.$refs[`category-${category.code}`]
|
||||||
if (categoryRef?.[0]) {
|
if (categoryRef?.[0]) {
|
||||||
return {
|
return {
|
||||||
|
@ -254,16 +254,13 @@ const handleScroll = (e) => {
|
||||||
|
|
||||||
// 更新当前 active 的分类
|
// 更新当前 active 的分类
|
||||||
if (currentCategory && categoryActive.value.code !== currentCategory.code) {
|
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(() => {
|
const availableCategories = computed(() => {
|
||||||
if (!categoryList.value?.length || !processDefinitionGroup.value) {
|
if (!categoryList.value?.length || !processDefinitionGroup.value) {
|
||||||
return []
|
return []
|
||||||
|
@ -273,10 +270,15 @@ const availableCategories = computed(() => {
|
||||||
const availableCategoryCodes = Object.keys(processDefinitionGroup.value)
|
const availableCategoryCodes = Object.keys(processDefinitionGroup.value)
|
||||||
|
|
||||||
// 过滤出有流程的分类
|
// 过滤出有流程的分类
|
||||||
return categoryList.value.filter(category =>
|
return categoryList.value.filter((category: CategoryVO) =>
|
||||||
availableCategoryCodes.includes(category.code)
|
availableCategoryCodes.includes(category.code)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** 初始化 */
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue