From 8807caa3eb47eba09d3174c75e9d5b70c6e44b84 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 15 Dec 2025 20:40:37 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BC=98=E5=8C=96=20bpm=20?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=EF=BC=8C=E9=87=8D=E7=82=B9?= =?UTF-8?q?=E5=A4=84=E7=90=86=20back=20=E9=80=BB=E8=BE=91=EF=BC=8Csearch?= =?UTF-8?q?=20=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processInstance/create/index.vue | 3 +- .../processInstance/detail/audit/index.vue | 44 +++--- .../processInstance/detail/index.vue | 57 +++++--- src/pages/bpm/components/copy-list.vue | 113 ++++++++------- src/pages/bpm/components/copy-search-form.vue | 32 +++-- src/pages/bpm/components/done-list.vue | 109 ++++++++------- src/pages/bpm/components/done-search-form.vue | 37 +++-- src/pages/bpm/components/my-list.vue | 126 ++++++++--------- src/pages/bpm/components/my-search-form.vue | 37 +++-- src/pages/bpm/components/todo-list.vue | 131 +++++++++--------- src/pages/bpm/components/todo-search-form.vue | 37 +++-- src/pages/bpm/index.vue | 34 +---- 12 files changed, 412 insertions(+), 348 deletions(-) diff --git a/src/pages-bpm/processInstance/create/index.vue b/src/pages-bpm/processInstance/create/index.vue index 6bca388..c26d05f 100644 --- a/src/pages-bpm/processInstance/create/index.vue +++ b/src/pages-bpm/processInstance/create/index.vue @@ -92,6 +92,7 @@ import { onLoad } from '@dcloudio/uni-app' import { computed, ref } from 'vue' import { getCategorySimpleList } from '@/api/bpm/category' import { getProcessDefinitionList } from '@/api/bpm/definition' +import { navigateBackPlus } from '@/utils'; definePage({ style: { @@ -148,7 +149,7 @@ const groupedDefinitions = computed>(() => { /** 返回上一页 */ function handleBack() { - uni.navigateBack() + navigateBackPlus('/pages/bpm/index') } /** 搜索 */ diff --git a/src/pages-bpm/processInstance/detail/audit/index.vue b/src/pages-bpm/processInstance/detail/audit/index.vue index 90d0c2b..96603dc 100644 --- a/src/pages-bpm/processInstance/detail/audit/index.vue +++ b/src/pages-bpm/processInstance/detail/audit/index.vue @@ -43,9 +43,14 @@ diff --git a/src/pages-bpm/processInstance/detail/index.vue b/src/pages-bpm/processInstance/detail/index.vue index a7829d8..276efe6 100644 --- a/src/pages-bpm/processInstance/detail/index.vue +++ b/src/pages-bpm/processInstance/detail/index.vue @@ -117,6 +117,7 @@ import { getProcessInstance } from '@/api/bpm/processInstance' import { getTaskListByProcessInstanceId } from '@/api/bpm/task' import { useUserStore } from '@/store' import { formatDateTime, formatPast } from '@/utils/date' +import { navigateBackPlus } from '@/utils'; definePage({ style: { @@ -135,8 +136,9 @@ const orderAsc = ref(true) const runningTask = computed(() => { return tasks.value.find((task) => { // 待处理状态 - if (task.status !== 1 && task.status !== 6) + if (task.status !== 1 && task.status !== 6) { return false + } // 当前用户是处理人 return task.assigneeUser?.id === userStore.userInfo?.id }) @@ -146,12 +148,15 @@ const runningTask = computed(() => { const sortedTasks = computed(() => { const list = [...tasks.value].filter(t => t.status !== 4) // 过滤已取消 list.sort((a, b) => { - if (a.endTime && b.endTime) + if (a.endTime && b.endTime) { return orderAsc.value ? a.endTime - b.endTime : b.endTime - a.endTime - if (a.endTime) + } + if (a.endTime) { return orderAsc.value ? -1 : 1 - if (b.endTime) + } + if (b.endTime) { return orderAsc.value ? 1 : -1 + } return orderAsc.value ? a.createTime - b.createTime : b.createTime - a.createTime }) return list @@ -159,7 +164,7 @@ const sortedTasks = computed(() => { /** 返回上一页 */ function handleBack() { - uni.navigateBack() + navigateBackPlus('/pages/bpm/index') } /** 切换排序 */ @@ -184,54 +189,68 @@ function getStatusText(status?: number) { /** 获取状态标签类型 */ function getStatusType(status?: number): 'default' | 'primary' | 'success' | 'warning' | 'danger' { - if ([1, 6, 7].includes(status ?? 0)) + if ([1, 6, 7].includes(status ?? 0)) { return 'primary' - if (status === 2) + } + if (status === 2) { return 'success' - if (status === 3) + } + if (status === 3) { return 'danger' - if (status === 4 || status === 5) + } + if (status === 4 || status === 5) { return 'warning' + } return 'default' } /** 获取任务圆点样式 */ function getTaskDotClass(task: Task) { - if ([1, 6, 7].includes(task.status)) + if ([1, 6, 7].includes(task.status)) { return 'bg-[#1890ff]' - if (task.status === 2) + } + if (task.status === 2) { return 'bg-[#52c41a]' - if (task.status === 3) + } + if (task.status === 3) { return 'bg-[#ff4d4f]' - if (task.status === 5) + } + if (task.status === 5) { return 'bg-[#faad14]' + } return 'bg-[#d9d9d9]' } /** 获取状态文本样式 */ function getStatusTextClass(status: number) { - if ([1, 6, 7].includes(status)) + if ([1, 6, 7].includes(status)) { return 'text-[#1890ff]' - if (status === 2) + } + if (status === 2) { return 'text-[#52c41a]' - if (status === 3) + } + if (status === 3) { return 'text-[#ff4d4f]' - if (status === 5) + } + if (status === 5) { return 'text-[#faad14]' + } return 'text-[#999]' } /** 同意 */ function handleApprove() { - if (!runningTask.value) + if (!runningTask.value) { return + } uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${runningTask.value.id}&pass=true` }) } /** 拒绝 */ function handleReject() { - if (!runningTask.value) + if (!runningTask.value) { return + } uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${runningTask.value.id}&pass=false` }) } diff --git a/src/pages/bpm/components/copy-list.vue b/src/pages/bpm/components/copy-list.vue index ba1dbaa..2ebcdbe 100644 --- a/src/pages/bpm/components/copy-list.vue +++ b/src/pages/bpm/components/copy-list.vue @@ -1,54 +1,55 @@ @@ -64,17 +65,13 @@ import CopySearchForm from './copy-search-form.vue' import './index.scss' const props = defineProps<{ - searchVisible?: boolean -}>() - -const emit = defineEmits<{ - 'update:searchVisible': [value: boolean] + active?: boolean }>() const total = ref(0) const list = ref([]) const loadMoreState = ref('loading') -const searchPopupVisible = ref(false) +const isFirstLoad = ref(true) const queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -133,16 +130,18 @@ onReachBottom(() => { loadMore() }) -watch(() => props.searchVisible, (val) => { - searchPopupVisible.value = val ?? false -}) - -watch(searchPopupVisible, (val) => { - emit('update:searchVisible', val) +/** 监听激活状态,刷新数据 */ +watch(() => props.active, (val) => { + if (val && !isFirstLoad.value) { + queryParams.pageNo = 1 + list.value = [] + getList() + } }) /** 初始化 */ onMounted(() => { getList() + isFirstLoad.value = false }) diff --git a/src/pages/bpm/components/copy-search-form.vue b/src/pages/bpm/components/copy-search-form.vue index 1837271..18a52ef 100644 --- a/src/pages/bpm/components/copy-search-form.vue +++ b/src/pages/bpm/components/copy-search-form.vue @@ -1,4 +1,13 @@