refactor: 修改终审列表参数

bak
elseif 1 year ago
parent 409f9e9c51
commit 98842219bb

1
components.d.ts vendored

@ -20,6 +20,7 @@ declare module 'vue' {
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']

@ -1,15 +1,33 @@
import type { FinalParam, ResetParam } from '/#/api'
import { http } from '@/utils/http/axios'
import { notEmpty } from '@/utils'
import { pickBy } from 'lodash-es'
import { formatToDate2 } from '@/utils/dateUtil'
/**
*
* @returns
*/
export async function getFinalList(params: FinalParam) {
const notEmptyParams = pickBy(params, notEmpty)
Object.keys(notEmptyParams).forEach((key) => {
const val = notEmptyParams[key]
if (key === 'izuptime') {
const start = formatToDate2(val[0])
const end = formatToDate2(val[1])
notEmptyParams[key] = `${start}-${end}`
}
if (Array.isArray(notEmptyParams[key]))
notEmptyParams[key] = val.join(',')
})
const res = await http.request({
url: `/flow/task/listfinal`,
method: 'get',
params,
params: notEmptyParams,
})
const { data: { list, totalPage } } = res

@ -5,7 +5,7 @@ export interface AsideEntity {
label: string
defaultValue?: any
isDefaultFilter?: boolean// 是否为默认显示选项(不能隐藏)
inFilterList?: boolean// 是否出现在过滤配置选项中
inFilterList?: boolean// 是否出现在过滤配置选项中(这个名字不好为false代表只用于客户端的显示配置不作为参数传递给服务器端)
render?: boolean// 是否作为单独组件渲染
key: string
component: Component

@ -21,9 +21,9 @@ const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({})
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
Object.keys(asideMap).forEach((key) => {
const entity = asideMap[key]
const { defaultValue } = entity
asideValue[key] = defaultValue
const { defaultValue, inFilterList } = asideMap[key]
if (inFilterList !== false)
asideValue[key] = defaultValue
})
const filterModalRef = ref(null)

@ -6,12 +6,13 @@ import type { RowData } from '@/config/final'
import { findKey, headRules } from '@/config/final'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user'
import { useFinal } from '@/store/modules/final'
import { getViewportOffset } from '@/utils/domUtils'
import { isBoolean } from '@/utils/is'
import ConfrimModal from '@/views/task/modal/ConfrimModal.vue'
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
import { NDataTable, useDialog, useMessage } from 'naive-ui'
import { computed, h, nextTick, onMounted, reactive, ref, unref } from 'vue'
import { computed, h, nextTick, onMounted, reactive, ref, unref, watch } from 'vue'
import { Action, CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal } from '../comp'
import type { ApprovalParam } from '/#/api'
@ -125,9 +126,11 @@ const selectionIds = ref<DataTableRowKey[]>([])
const userStore = useUser()
const dialog = useDialog()
const message = useMessage()
const finalStore = useFinal()
async function query(page: number, pageSize: number) {
const result = await getFinalList({ sortorder: 'asc', pageSize, currPage: page, sortname: '' })
const filterParams = unref(finalStore.getAsideValue)
const result = await getFinalList({ sortorder: 'asc', pageSize, currPage: page, sortname: '', ...filterParams })
const { data, pageCount } = result
tableData.value = data
pagination.page = page
@ -381,6 +384,20 @@ function reload() {
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
query(page!, pageSize!)
}
watch(() => finalStore.asideValue, (newVal, oldVal) => {
refreshHandler()
}, { deep: true })
function reset() {
pagination.page = 1
pagination.pageCount = 1
pagination.pageSize = 1
}
async function refreshHandler() {
query(pagination.page, pagination.pageSize)
}
</script>
<template>

@ -31,6 +31,9 @@ const sortBy: PictureSortParam = {
}
function setBatch(value: boolean) {
if (totalCount.value === 0)
return
batch.value = value
if (value === false) {
selectItems.value.forEach(item => (item.checked = false))
@ -347,9 +350,9 @@ function previewHandler(event: MouseEvent) {
</div>
</div>
<div class="right">
<n-scrollbar style="max-height: 100%">
<n-scrollbar v-if="totalCount > 0" style="max-height: 100%">
<div class="header">
<span>相似图片(9)</span>
<span>相似图片{{ totalCount }}</span>
<SvgIcon
style="margin-right: 20px;cursor: pointer;" name="max" size="24"
@click="showModal(batchModalRef)"
@ -372,6 +375,7 @@ function previewHandler(event: MouseEvent) {
</div>
</div>
</n-scrollbar>
<n-empty v-else description="暂无数据" />
</div>
</div>
@ -398,7 +402,7 @@ function previewHandler(event: MouseEvent) {
</n-tabs>
<ConfrimModal ref="confrimModalRef" @commit="reject" />
<BatchModal ref="batchModalRef" @reject="rejectHandler" @approval="approvalHandler" />
<CustomSettingModal ref="CustomSettingModalRef" :reviewType="3"/>
<CustomSettingModal ref="CustomSettingModalRef" :review-type="3" />
</div>
</template>

@ -296,15 +296,15 @@ async function refreshHandler() {
const packageid = taskStore.getPackageid
const taskId = taskStore.getActiveId
if (!packageid || !taskId)
return
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
pagination.pageNo = 1
pagination.pageSize = 30
listData.value.length = 0
if (!packageid || !taskId)
return
const list = await featchList()
listData.value = list
layout()

Loading…
Cancel
Save