forked from verdnatura/salix-front
refs #6694 perf: remove comments
This commit is contained in:
parent
817a4e9e3f
commit
d8e7f3acaa
|
@ -7,10 +7,6 @@ const emit = defineEmits(['update:modelValue', 'update:options']);
|
|||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
// const citiesLocationOptions = ref([]);
|
||||
// const provincesLocationOptions = ref([]);
|
||||
// const countriesOptions = ref([]);
|
||||
// const townsRef = ref([]);
|
||||
const postcodesOptions = ref([]);
|
||||
const postcodesRef = ref(null);
|
||||
|
||||
|
@ -72,48 +68,14 @@ function showLabel(data) {
|
|||
}
|
||||
|
||||
function locationFilter(value) {
|
||||
// if(value==='') return [];
|
||||
let where = { limit: 30 };
|
||||
const params = { value };
|
||||
postcodesRef.value.fetch({ where: Object.assign(where, params) });
|
||||
// postcodesRef.value.fetch({
|
||||
// where: {
|
||||
// or: [
|
||||
// { code: { like: '%4660%' } },
|
||||
// { 'town.name': { like: '%Alz%' } }
|
||||
// ]
|
||||
// }});
|
||||
// const townParams = { name: { like: `%${val}%` } };
|
||||
|
||||
// townsRef.value.fetch({ where: Object.assign(where, townParams) });
|
||||
}
|
||||
function handleFetch( data) {
|
||||
// if (from === 'towns') {
|
||||
// data = data.reduce((acc, town) => {
|
||||
// for (const postcode of town.postcodes) {
|
||||
// console.log(postcode);
|
||||
// acc.push({ ...postcode, town:{name: town.name, province: town.province} });
|
||||
// }
|
||||
|
||||
// return acc;
|
||||
// }, []);
|
||||
// }
|
||||
// console.log(from, data);
|
||||
postcodesOptions.value = data;
|
||||
}
|
||||
</script>
|
||||
<!-- let where = { limit: 30 };
|
||||
|
||||
const params = { 'town': false, 'townsFk': {like: ``} };
|
||||
where = Object.assign(where, params);
|
||||
postcodesRef.value.fetch({ where});
|
||||
} -->
|
||||
<!-- <FetchData
|
||||
ref="townsRef"
|
||||
@on-fetch="(data) => handleFetch('towns', data)"
|
||||
auto-load
|
||||
url="Towns/location"
|
||||
/> -->
|
||||
<template>
|
||||
<FetchData
|
||||
ref="postcodesRef"
|
||||
|
@ -121,18 +83,6 @@ postcodesRef.value.fetch({ where});
|
|||
@on-fetch="(data) =>handleFetch(data)"
|
||||
auto-load
|
||||
/>
|
||||
<!-- <FetchData
|
||||
@on-fetch="(data) => (provincesLocationOptions = data)"
|
||||
auto-load
|
||||
url="Provinces/location"
|
||||
/>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (countriesOptions = data)"
|
||||
auto-load
|
||||
url="Countries"
|
||||
/> -->
|
||||
<!-- :filter-options="['code','town.name']"
|
||||
:filter-rules="['val.length>2']" -->
|
||||
<VnSelectCreate
|
||||
v-if="postcodesRef"
|
||||
v-model="value"
|
||||
|
|
Loading…
Reference in New Issue