feat: 完善首页过滤

bak
elseif 1 year ago
parent 11ddb58b3f
commit ba5cd29005

@ -57,7 +57,7 @@ export async function updateCondition(params: FilterUpdate) {
export async function deleteCondition(params: { ids: string }) {
return http.request({
url: `/ocr/ocrUsersearch/deleteBatch`,
method: 'delete',
method: 'get',
params,
})
}

@ -69,6 +69,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: false,
key: 'izupload',
component: PictureUploadVue,
inFilterList: false,
},
izcustomtype: {
label: '客户类型',

@ -81,7 +81,7 @@ const loading = ref(true)
const pagination = reactive({
page: 1,
pageCount: 1,
pageSize: 2,
pageSize: 10,
})
const tableData = ref<Array<RowData>>([])
const keyword = ref('')
@ -99,7 +99,7 @@ async function query(page: number, pageSize: number) {
function afterLeave() {
pagination.page = 1
pagination.pageCount = 1
pagination.pageSize = 5
pagination.pageSize = 10
}
const selectionIds = ref<DataTableRowKey[]>([])
@ -239,7 +239,7 @@ defineExpose({
const inputHandler = debounce((word) => {
keyword.value = word
query(1, 10)
query(1, 5)
}, 300)
</script>

@ -6,6 +6,7 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2 } from '@/utils/dateUtil'
defineOptions({ name: 'NewFilterModal' })
@ -95,6 +96,7 @@ const formValue = reactive<FormType>({
function handleSumbit(e: MouseEvent) {
e.preventDefault()
const v = formRef.value
formRef.value?.validate((errors) => {
if (errors)
return
@ -105,7 +107,7 @@ function handleSumbit(e: MouseEvent) {
return {
searchfield: type!,
searchtype: operator!,
searchvalue: result!,
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
}
@ -113,6 +115,7 @@ function handleSumbit(e: MouseEvent) {
const param: FilterCondition = {
searchname: formValue.name!,
type: 0,
ocrUsersearchchildList: list,
}
@ -124,6 +127,19 @@ function handleSumbit(e: MouseEvent) {
})
}
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === 'izyear') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
if (Array.isArray(searchvalue))
return searchvalue.join(',')
return searchvalue
}
function createCondition() {
formValue.conditions.push({
type: null,
@ -293,8 +309,7 @@ defineExpose({
/>
</n-space>
<n-select
v-else v-model:value="item.result" style="margin-left: 8px;" placeholder="请选择"
:options="resultOptions"
v-else v-model:value="item.result" style="margin-left: 8px;" placeholder="请选择" :options="resultOptions"
/>
<n-button :style="noBorderInput" icon-placement="right" @click="removeCondition(index)">
<template #icon>

@ -135,7 +135,9 @@ async function featchList() {
}
pagination.pageNo += 1
const result = await getPictureList({ ...pagination, ...contentParams })
const filterParams = unref(configStore.getAsideValue)
const result = await getPictureList({ ...pagination, ...contentParams, ...filterParams })
const { data, pageCount } = result
canloadMore = pageCount >= pagination.pageNo && pageCount > 0

@ -35,9 +35,9 @@ const show = ref(false)
const flag = ref(true)
const formInline: FormState = reactive({
enterprisecode: '演示公司',
username: 'yanshi01',
password: '123456',
enterprisecode: '三方系统标识8',
username: '13311111111',
password: '12345678l',
})
const formSms: FormSms = reactive({

@ -67,20 +67,20 @@ function validate(items: any[]) {
if (items.length === 0)
return '至少选中一个任务'
const useInfo = userStore.getUserInfo
const username = useInfo.loginname
// const useInfo = userStore.getUserInfo
// const username = useInfo.loginname
for (const item of items) {
const { iztrueorfalse, states, assignee } = item
if (iztrueorfalse === null)
return '未判别真假'
// for (const item of items) {
// const { iztrueorfalse, states, assignee } = item
// if (iztrueorfalse === null)
// return ''
else if (states !== 2)
return '审批状态不合法'
// else if (states !== 2)
// return ''
else if (assignee !== username)
return '审批人不一致'
}
// else if (assignee !== username)
// return ''
// }
return null
}

@ -65,17 +65,17 @@ function validate(items: any[]) {
if (items.length === 0)
return '至少选中一个任务'
for (const item of items) {
const { iztrueorfalse, history, states } = item
if (iztrueorfalse !== null)
return '存在已经辨识过的任务'
// for (const item of items) {
// const { iztrueorfalse, history, states } = item
// if (iztrueorfalse !== null)
// return ''
else if (history)
return '包含历史数据'
// else if (history)
// return ''
else if (states !== 1 && states !== 2)
return '审批状态不合法'
}
// else if (states !== 1 && states !== 2)
// return ''
// }
return null
}
@ -205,8 +205,6 @@ async function handleSelect(item: any) {
const { data, total } = await getTaskDetailPictureList(workStore.activeId, taskId, { ...taskpagination, ...sortBy })
taskDetailPictureList.value = data
totalCount.value = total
debugger
}
async function sortHandler(orderby: 'pictureResult' | 'fromuptime') {

1
types/api.d.ts vendored

@ -24,6 +24,7 @@ export interface ConditionEntry {
export interface FilterCondition {
searchname: string
type: number
ocrUsersearchchildList: ConditionEntry[]
}

Loading…
Cancel
Save