|
|
@ -112,7 +112,7 @@ defineExpose({ |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="pa-2 menu-filter-dropdown bg-gray-50" |
|
|
|
class="p-6 menu-filter-dropdown bg-gray-50" |
|
|
|
:class="{ 'shadow-xl min-w-[430px] max-w-[630px] max-h-[max(80vh,500px)] overflow-auto': !nested, 'border-1 w-full': nested }" |
|
|
|
:class="{ 'shadow-xl min-w-[430px] max-w-[630px] max-h-[max(80vh,500px)] overflow-auto': !nested, 'border-1 w-full': nested }" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-if="filters && filters.length" class="nc-filter-grid mb-2" @click.stop> |
|
|
|
<div v-if="filters && filters.length" class="nc-filter-grid mb-2" @click.stop> |
|
|
@ -132,13 +132,12 @@ defineExpose({ |
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-model:value="filter.logical_op" |
|
|
|
v-model:value="filter.logical_op" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
size="small" |
|
|
|
class="shrink grow-0" |
|
|
|
class="flex-shrink-1 flex-grow-0 elevation-0 caption !text-xs" |
|
|
|
|
|
|
|
placeholder="Group op" |
|
|
|
placeholder="Group op" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
@change="saveOrUpdate(filter, i)" |
|
|
|
@change="saveOrUpdate(filter, i)" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value" class="!text-xs"> |
|
|
|
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value" class=""> |
|
|
|
{{ op.text }} |
|
|
|
{{ op.text }} |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
@ -173,20 +172,19 @@ defineExpose({ |
|
|
|
/> |
|
|
|
/> |
|
|
|
<span v-else /> |
|
|
|
<span v-else /> |
|
|
|
|
|
|
|
|
|
|
|
<span v-if="!i" class="text-xs d-flex align-center">{{ $t('labels.where') }}</span> |
|
|
|
<span v-if="!i" class="flex items-center">{{ $t('labels.where') }}</span> |
|
|
|
|
|
|
|
|
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
v-model:value="filter.logical_op" |
|
|
|
v-model:value="filter.logical_op" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
size="small" |
|
|
|
class="h-full" |
|
|
|
class="h-full !text-xs" |
|
|
|
|
|
|
|
hide-details |
|
|
|
hide-details |
|
|
|
:disabled="filter.readOnly" |
|
|
|
:disabled="filter.readOnly" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
@change="filterUpdateCondition(filter, i)" |
|
|
|
@change="filterUpdateCondition(filter, i)" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value" class="!text-xs"> |
|
|
|
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value"> |
|
|
|
{{ op.text }} |
|
|
|
{{ op.text }} |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
@ -194,7 +192,7 @@ defineExpose({ |
|
|
|
<FieldListAutoCompleteDropdown |
|
|
|
<FieldListAutoCompleteDropdown |
|
|
|
:key="`${i}_6`" |
|
|
|
:key="`${i}_6`" |
|
|
|
v-model="filter.fk_column_id" |
|
|
|
v-model="filter.fk_column_id" |
|
|
|
class="caption nc-filter-field-select" |
|
|
|
class="nc-filter-field-select" |
|
|
|
:columns="columns" |
|
|
|
:columns="columns" |
|
|
|
:disabled="filter.readOnly" |
|
|
|
:disabled="filter.readOnly" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
@ -204,8 +202,7 @@ defineExpose({ |
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-model:value="filter.comparison_op" |
|
|
|
v-model:value="filter.comparison_op" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
size="small" |
|
|
|
class="caption nc-filter-operation-select" |
|
|
|
class="caption nc-filter-operation-select !text-xs" |
|
|
|
|
|
|
|
:placeholder="$t('labels.operation')" |
|
|
|
:placeholder="$t('labels.operation')" |
|
|
|
density="compact" |
|
|
|
density="compact" |
|
|
|
variant="solo" |
|
|
|
variant="solo" |
|
|
@ -213,7 +210,7 @@ defineExpose({ |
|
|
|
hide-details |
|
|
|
hide-details |
|
|
|
@change="filterUpdateCondition(filter, i)" |
|
|
|
@change="filterUpdateCondition(filter, i)" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="compOp in comparisonOpList" :key="compOp.value" :value="compOp.value" class="!text-xs"> |
|
|
|
<a-select-option v-for="compOp in comparisonOpList" :key="compOp.value" :value="compOp.value" class=""> |
|
|
|
{{ compOp.text }} |
|
|
|
{{ compOp.text }} |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
@ -232,7 +229,6 @@ defineExpose({ |
|
|
|
<a-checkbox |
|
|
|
<a-checkbox |
|
|
|
v-else-if="types[filter.field] === 'boolean'" |
|
|
|
v-else-if="types[filter.field] === 'boolean'" |
|
|
|
v-model:checked="filter.value" |
|
|
|
v-model:checked="filter.value" |
|
|
|
size="small" |
|
|
|
|
|
|
|
dense |
|
|
|
dense |
|
|
|
:disabled="filter.readOnly" |
|
|
|
:disabled="filter.readOnly" |
|
|
|
@change="saveOrUpdate(filter, i)" |
|
|
|
@change="saveOrUpdate(filter, i)" |
|
|
@ -241,8 +237,7 @@ defineExpose({ |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
:key="`${i}_7`" |
|
|
|
:key="`${i}_7`" |
|
|
|
v-model:value="filter.value" |
|
|
|
v-model:value="filter.value" |
|
|
|
size="small" |
|
|
|
class="nc-filter-value-select" |
|
|
|
class="caption nc-filter-value-select" |
|
|
|
|
|
|
|
:disabled="filter.readOnly" |
|
|
|
:disabled="filter.readOnly" |
|
|
|
@click.stop |
|
|
|
@click.stop |
|
|
|
@input="saveOrUpdate(filter, i)" |
|
|
|
@input="saveOrUpdate(filter, i)" |
|
|
@ -252,8 +247,8 @@ defineExpose({ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex gap-2 my-2"> |
|
|
|
<div class="flex gap-2 mb-2 mt-4"> |
|
|
|
<a-button size="small" class="elevation-0 text-capitalize text-grey" @click.stop="addFilter"> |
|
|
|
<a-button class="elevation-0 text-capitalize" @click.stop="addFilter"> |
|
|
|
<div class="flex align-center gap-1"> |
|
|
|
<div class="flex align-center gap-1"> |
|
|
|
<!-- <v-icon small color="grey"> mdi-plus </v-icon> --> |
|
|
|
<!-- <v-icon small color="grey"> mdi-plus </v-icon> --> |
|
|
|
<MdiAddIcon /> |
|
|
|
<MdiAddIcon /> |
|
|
@ -261,7 +256,7 @@ defineExpose({ |
|
|
|
{{ $t('activity.addFilter') }} |
|
|
|
{{ $t('activity.addFilter') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
<a-button size="small" class="elevation-0 text-capitalize text-grey" @click.stop="addFilterGroup"> |
|
|
|
<a-button class="text-capitalize !text-gray-500" @click.stop="addFilterGroup"> |
|
|
|
<div class="flex align-center gap-1"> |
|
|
|
<div class="flex align-center gap-1"> |
|
|
|
<!-- <v-icon small color="grey"> mdi-plus </v-icon> --> |
|
|
|
<!-- <v-icon small color="grey"> mdi-plus </v-icon> --> |
|
|
|
<MdiAddIcon /> |
|
|
|
<MdiAddIcon /> |
|
|
@ -278,15 +273,10 @@ defineExpose({ |
|
|
|
.nc-filter-grid { |
|
|
|
.nc-filter-grid { |
|
|
|
display: grid; |
|
|
|
display: grid; |
|
|
|
grid-template-columns: 18px 70px auto auto auto; |
|
|
|
grid-template-columns: 18px 70px auto auto auto; |
|
|
|
column-gap: 6px; |
|
|
|
@apply gap-[12px] |
|
|
|
row-gap: 6px; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-btn, .ant-select, .ant-input) { |
|
|
|
|
|
|
|
@apply "!text-xs"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-select-item-option) { |
|
|
|
:deep(.ant-select-item-option) { |
|
|
|
@apply "!min-w-full"; |
|
|
|
@apply "!min-w-full"; |
|
|
|
} |
|
|
|
} |
|
|
|