Skip to content

Commit 24e1374

Browse files
committed
【功能完善】工作流:详情优化
1 parent 3a9f8db commit 24e1374

File tree

1 file changed

+16
-14
lines changed
  • src/views/bpm/processInstance/create

1 file changed

+16
-14
lines changed

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<script lang="ts" setup>
8686
import * as DefinitionApi from '@/api/bpm/definition'
8787
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
88-
import { CategoryApi } from '@/api/bpm/category'
88+
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
8989
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
9090
import { groupBy } from 'lodash-es'
9191
@@ -221,14 +221,14 @@ const handleSelect = async (row, formVariables?) => {
221221
processDefinitionDetailRef.value?.initProcessInfo(row, formVariables)
222222
}
223223
224-
/** 处理滚动事件 */
225-
const handleScroll = (e) => {
224+
/** 处理滚动事件,和左侧分类联动 */
225+
const handleScroll = (e: any) => {
226226
// 直接使用事件对象获取滚动位置
227227
const scrollTop = e.scrollTop
228228
229229
// 获取所有分类区域的位置信息
230230
const categoryPositions = categoryList.value
231-
.map((category) => {
231+
.map((category: CategoryVO) => {
232232
const categoryRef = proxy.$refs[`category-${category.code}`]
233233
if (categoryRef?.[0]) {
234234
return {
@@ -254,29 +254,31 @@ const handleScroll = (e) => {
254254
255255
// 更新当前 active 的分类
256256
if (currentCategory && categoryActive.value.code !== currentCategory.code) {
257-
categoryActive.value = categoryList.value.find((c) => c.code === currentCategory.code)
257+
categoryActive.value = categoryList.value.find(
258+
(c: CategoryVO) => c.code === currentCategory.code
259+
)
258260
}
259261
}
260262
261-
/** 初始化 */
262-
onMounted(() => {
263-
getList()
264-
})
265-
266-
/** 过滤出有流程的分类列表 */
263+
/** 过滤出有流程的分类列表。目的:只展示有流程的分类 */
267264
const availableCategories = computed(() => {
268265
if (!categoryList.value?.length || !processDefinitionGroup.value) {
269266
return []
270267
}
271-
268+
272269
// 获取所有有流程的分类代码
273270
const availableCategoryCodes = Object.keys(processDefinitionGroup.value)
274-
271+
275272
// 过滤出有流程的分类
276-
return categoryList.value.filter(category =>
273+
return categoryList.value.filter((category: CategoryVO) =>
277274
availableCategoryCodes.includes(category.code)
278275
)
279276
})
277+
278+
/** 初始化 */
279+
onMounted(() => {
280+
getList()
281+
})
280282
</script>
281283

282284
<style lang="scss" scoped>

0 commit comments

Comments
 (0)