|
|
|
@ -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>
|
|
|
|
|