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 }) { export async function deleteCondition(params: { ids: string }) {
return http.request({ return http.request({
url: `/ocr/ocrUsersearch/deleteBatch`, url: `/ocr/ocrUsersearch/deleteBatch`,
method: 'delete', method: 'get',
params, params,
}) })
} }

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

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

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

@ -135,7 +135,9 @@ async function featchList() {
} }
pagination.pageNo += 1 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 const { data, pageCount } = result
canloadMore = pageCount >= pagination.pageNo && pageCount > 0 canloadMore = pageCount >= pagination.pageNo && pageCount > 0

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

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

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

1
types/api.d.ts vendored

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

Loading…
Cancel
Save