refs #6863 fix: VnSelect + url, VnLocation
gitea/salix-front/pipeline/pr-test This commit looks good
Details
gitea/salix-front/pipeline/pr-test This commit looks good
Details
This commit is contained in:
parent
87f81eb80a
commit
c916bd5945
|
@ -50,7 +50,10 @@ const value = computed({
|
||||||
return $props.modelValue;
|
return $props.modelValue;
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
emit('update:modelValue', value);
|
emit(
|
||||||
|
'update:modelValue',
|
||||||
|
postcodesOptions.value.find((p) => p.code === value)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -101,16 +104,11 @@ function handleFetch(data) {
|
||||||
:label="t('Location')"
|
:label="t('Location')"
|
||||||
:placeholder="t('Search by postalcode, town, province or country')"
|
:placeholder="t('Search by postalcode, town, province or country')"
|
||||||
@input-value="locationFilter"
|
@input-value="locationFilter"
|
||||||
:default-filter="true"
|
:default-filter="false"
|
||||||
:input-debounce="300"
|
:input-debounce="300"
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
use-input
|
|
||||||
clearable
|
clearable
|
||||||
hide-selected
|
|
||||||
fill-input
|
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewPostcode @on-data-saved="locationFilter()" />
|
<CreateNewPostcode @on-data-saved="locationFilter()" />
|
||||||
|
|
|
@ -111,15 +111,15 @@ async function fetchFilter(val) {
|
||||||
return dataRef.value.fetch({ fields, where, order: sortBy, limit });
|
return dataRef.value.fetch({ fields, where, order: sortBy, limit });
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterHandler(val, update) {
|
async function filterHandler(val, update) {
|
||||||
|
if (!$props.defaultFilter) return update();
|
||||||
|
let newOptions;
|
||||||
|
if ($props.url) {
|
||||||
|
newOptions = await fetchFilter(val);
|
||||||
|
} else newOptions = filter(val, myOptionsOriginal.value);
|
||||||
update(
|
update(
|
||||||
async () => {
|
() => {
|
||||||
if (!$props.defaultFilter) return;
|
myOptions.value = newOptions;
|
||||||
// if ($props.url) {
|
|
||||||
// myOptions.value = await fetchFilter(val);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
myOptions.value = filter(val, myOptionsOriginal.value);
|
|
||||||
},
|
},
|
||||||
(ref) => {
|
(ref) => {
|
||||||
if (val !== '' && ref.options.length > 0) {
|
if (val !== '' && ref.options.length > 0) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceInBasicData', () => {
|
describe('InvoiceInBasicData', () => {
|
||||||
const selects = '.q-form .q-select';
|
const selects = ':nth-child(1) > :nth-child(1) > .q-field';
|
||||||
const appendBtns = 'label button';
|
const appendBtns = 'label button';
|
||||||
const dialogAppendBtns = '.q-dialog label button';
|
const dialogAppendBtns = '.q-dialog label button';
|
||||||
const dialogInputs = '.q-dialog input';
|
const dialogInputs = '.q-dialog input';
|
||||||
|
@ -12,9 +12,7 @@ describe('InvoiceInBasicData', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should edit the provideer and supplier ref', () => {
|
it('should edit the provideer and supplier ref', () => {
|
||||||
cy.get(selects).eq(0).click();
|
cy.selectOption(selects, 'Bros');
|
||||||
cy.get(selects).eq(0).type('Bros');
|
|
||||||
cy.get(selects).eq(0).type('{enter}');
|
|
||||||
|
|
||||||
cy.get('[title="Reset"]').click();
|
cy.get('[title="Reset"]').click();
|
||||||
cy.get(appendBtns).eq(0).click();
|
cy.get(appendBtns).eq(0).click();
|
||||||
|
|
Loading…
Reference in New Issue