|
|
@@ -17,13 +17,18 @@
|
|
|
@update:page="pagination.onChange"
|
|
|
@update:page-size="pagination.onUpdatePageSize"
|
|
|
>
|
|
|
+ <template #tabs>
|
|
|
+ <NTabs v-model:value="activeTab" type="line" @update:value="handleTabChange">
|
|
|
+ <NTabPane name="unread" tab="未读" />
|
|
|
+ <NTabPane name="read" tab="已读" />
|
|
|
+ </NTabs>
|
|
|
+ </template>
|
|
|
<template #filters>
|
|
|
<n-select
|
|
|
- v-model:value="queryParams.isRead"
|
|
|
- placeholder="已读状态"
|
|
|
+ v-model:value="queryParams.title"
|
|
|
+ placeholder="通过名称搜索"
|
|
|
clearable
|
|
|
class="category-select"
|
|
|
- :options="readStatusOptions"
|
|
|
@update:value="handleSearch"
|
|
|
/>
|
|
|
<NButton secondary @click="handleReset">
|
|
|
@@ -240,8 +245,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { NButton, NEmpty } from 'naive-ui'
|
|
|
-import { computed, onMounted, reactive, ref } from 'vue'
|
|
|
+import { NButton, NEmpty, NTabPane, NTabs } from 'naive-ui'
|
|
|
+import { onMounted, reactive, ref } from 'vue'
|
|
|
import flowApi from '@/api/flow'
|
|
|
import UserAvatar from '@/components/common/UserAvatar.vue'
|
|
|
import DingFlowViewer from '@/components/flow-designer/viewer/DingFlowViewer.vue'
|
|
|
@@ -255,6 +260,7 @@ import { getRowDisplayTitle, getTaskDisplayName } from './utils/processDisplay'
|
|
|
const userStore = useUserStore()
|
|
|
const loading = ref(false)
|
|
|
const dataSource = ref([])
|
|
|
+const activeTab = ref('unread') // 默认未读
|
|
|
const pagination = reactive({
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
@@ -272,7 +278,7 @@ const pagination = reactive({
|
|
|
},
|
|
|
})
|
|
|
|
|
|
-const queryParams = reactive({ title: '', isRead: null })
|
|
|
+const queryParams = reactive({ title: '', isRead: 0 }) // 默认查询未读
|
|
|
const categoryTreeOptions = ref([])
|
|
|
const unreadCount = ref(0)
|
|
|
const selectedTaskKeys = ref([])
|
|
|
@@ -284,11 +290,6 @@ const approvalHistory = ref([])
|
|
|
const orderDetail = ref(null)
|
|
|
const orderLoading = ref(false)
|
|
|
|
|
|
-const readStatusOptions = computed(() => [
|
|
|
- { label: '未读', value: 0 },
|
|
|
- { label: '已读', value: 1 },
|
|
|
-])
|
|
|
-
|
|
|
function getCategoryDisplayName(row) {
|
|
|
return row?.categoryName || resolveFlowCategoryLabel(row?.category, categoryTreeOptions.value, '-') || '-'
|
|
|
}
|
|
|
@@ -377,6 +378,11 @@ async function loadUnreadCount() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function handleTabChange(tab) {
|
|
|
+ queryParams.isRead = tab === 'unread' ? 0 : 1
|
|
|
+ handleSearch()
|
|
|
+}
|
|
|
+
|
|
|
function handleSearch() {
|
|
|
pagination.page = 1
|
|
|
loadData()
|
|
|
@@ -384,7 +390,7 @@ function handleSearch() {
|
|
|
|
|
|
function handleReset() {
|
|
|
queryParams.title = ''
|
|
|
- queryParams.isRead = null
|
|
|
+ queryParams.isRead = activeTab.value === 'unread' ? 0 : 1
|
|
|
handleSearch()
|
|
|
}
|
|
|
|