Update current prefilter ui to save/cancel form
This commit is contained in:
parent
a52add3060
commit
95f1bafb80
@ -32,7 +32,7 @@
|
|||||||
class="position-static w-100"
|
class="position-static w-100"
|
||||||
>
|
>
|
||||||
<b-card-body
|
<b-card-body
|
||||||
class="px-2 pb-0 overflow-auto"
|
class="px-3 pb-0 overflow-auto"
|
||||||
>
|
>
|
||||||
<filter-toolbox
|
<filter-toolbox
|
||||||
v-if="componentFilter.length"
|
v-if="componentFilter.length"
|
||||||
|
|||||||
@ -5,49 +5,65 @@
|
|||||||
label-class="text-primary"
|
label-class="text-primary"
|
||||||
class="m-0"
|
class="m-0"
|
||||||
>
|
>
|
||||||
<b-row v-if="textInput">
|
<template v-if="textInput">
|
||||||
<b-col>
|
<c-input-expression
|
||||||
<b-form-group label-class="text-primary">
|
v-model="options.prefilter"
|
||||||
<c-input-expression
|
height="3.688rem"
|
||||||
v-model="options.prefilter"
|
lang="javascript"
|
||||||
height="3.688rem"
|
:suggestion-params="recordAutoCompleteParams"
|
||||||
lang="javascript"
|
/>
|
||||||
:suggestion-params="recordAutoCompleteParams"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<i18next
|
<i18next
|
||||||
path="recordList.record.prefilterFootnote"
|
path="recordList.record.prefilterFootnote"
|
||||||
tag="small"
|
tag="small"
|
||||||
class="text-muted"
|
class="text-muted"
|
||||||
>
|
|
||||||
<code>${record.values.fieldName}</code>
|
|
||||||
<code>${recordID}</code>
|
|
||||||
<code>${ownerID}</code>
|
|
||||||
<span><code>${userID}</code>, <code>${user.name}</code></span>
|
|
||||||
</i18next>
|
|
||||||
</b-form-group>
|
|
||||||
</b-col>
|
|
||||||
</b-row>
|
|
||||||
|
|
||||||
<filter-toolbox
|
|
||||||
v-else
|
|
||||||
v-model="filterGroup"
|
|
||||||
:module="module"
|
|
||||||
:mock.sync="mock"
|
|
||||||
reset-filter-on-created
|
|
||||||
start-empty
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="mt-1 d-flex align-items-center">
|
|
||||||
<b-button
|
|
||||||
variant="link"
|
|
||||||
size="sm"
|
|
||||||
class="ml-auto text-decoration-none"
|
|
||||||
@click="toggleFilterView"
|
|
||||||
>
|
>
|
||||||
{{ $t('recordList.prefilter.toggleInputType') }}
|
<code>${record.values.fieldName}</code>
|
||||||
</b-button>
|
<code>${recordID}</code>
|
||||||
</div>
|
<code>${ownerID}</code>
|
||||||
|
<span><code>${userID}</code>, <code>${user.name}</code></span>
|
||||||
|
</i18next>
|
||||||
|
|
||||||
|
<div class="d-flex align-items-center justify-content-end mt-1">
|
||||||
|
<b-button
|
||||||
|
variant="link"
|
||||||
|
size="sm"
|
||||||
|
class="text-decoration-none"
|
||||||
|
@click="toggleFilterInputType"
|
||||||
|
>
|
||||||
|
{{ $t('recordList.prefilter.toggleInputType') }}
|
||||||
|
</b-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<filter-toolbox
|
||||||
|
v-model="filterGroup"
|
||||||
|
:module="module"
|
||||||
|
:mock.sync="mock"
|
||||||
|
reset-filter-on-created
|
||||||
|
start-empty
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="d-flex align-items-center justify-content-end mt-1 gap-1">
|
||||||
|
<b-button
|
||||||
|
variant="light"
|
||||||
|
size="sm"
|
||||||
|
@click="toggleFilterInputType"
|
||||||
|
>
|
||||||
|
{{ $t('general:label.cancel') }}
|
||||||
|
</b-button>
|
||||||
|
|
||||||
|
<b-button
|
||||||
|
variant="primary"
|
||||||
|
size="sm"
|
||||||
|
class="ml-1"
|
||||||
|
@click="saveFilter"
|
||||||
|
>
|
||||||
|
{{ $t('general:label.save') }}
|
||||||
|
</b-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</c-form-table-wrapper>
|
</c-form-table-wrapper>
|
||||||
</template>
|
</template>
|
||||||
@ -144,11 +160,16 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggleFilterView () {
|
saveFilter (filter) {
|
||||||
if (!this.textInput) {
|
if (filter && filter[0] && !filter[0].filter[0].name) {
|
||||||
this.options.prefilter = this.parseFilter() || this.options.prefilter
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.options.prefilter = this.parseFilter()
|
||||||
|
this.toggleFilterInputType()
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleFilterInputType () {
|
||||||
this.textInput = !this.textInput
|
this.textInput = !this.textInput
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user