database structure fix
This commit is contained in:
@@ -34,13 +34,13 @@ const currencyHash = ref([])
|
|||||||
const ccountry = ref([])
|
const ccountry = ref([])
|
||||||
|
|
||||||
const ccountry_list = computed(() => {
|
const ccountry_list = computed(() => {
|
||||||
let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true);
|
let computed_list = settingsStore.ccountry_list.filter((c) => (c.offline == (settingsStore.online ? 'N' : 'Y')) || settingsStore.online == true);
|
||||||
console.log('COMPUTED_LIST',computed_list);
|
console.log('COMPUTED_LIST',computed_list);
|
||||||
return computed_list;
|
return computed_list;
|
||||||
})
|
})
|
||||||
|
|
||||||
const scountry_list = computed(() => {
|
const scountry_list = computed(() => {
|
||||||
let computed_list = settingsStore.ccountry_list.filter((c) => (c.online == (settingsStore.online ? 'Y' : 'N')) || settingsStore.online == true);
|
let computed_list = settingsStore.ccountry_list.filter((c) => (c.offline == (settingsStore.online ? 'N' : 'Y')) || settingsStore.online == true);
|
||||||
console.log('COMPUTED_LIST',computed_list);
|
console.log('COMPUTED_LIST',computed_list);
|
||||||
return computed_list;
|
return computed_list;
|
||||||
})
|
})
|
||||||
@@ -143,7 +143,7 @@ const fetch = async () => {
|
|||||||
name: country.country_name,
|
name: country.country_name,
|
||||||
code: country.country_code,
|
code: country.country_code,
|
||||||
status: country.status,
|
status: country.status,
|
||||||
online: country.only_online,
|
offline: country.only_offline,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -188,13 +188,13 @@ watch(ccodes, (codes) => {
|
|||||||
console.log("IP=", geoip.value);
|
console.log("IP=", geoip.value);
|
||||||
|
|
||||||
let fonud = false;
|
let fonud = false;
|
||||||
codes.forEach((c) => {
|
scountry_list.value.forEach((c) => {
|
||||||
if (c.code == geoip.value.iso_code) {
|
if (c.code == geoip.value.iso_code) {
|
||||||
settingsStore.country = c;
|
settingsStore.country = c;
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (fonud == false) settingsStore.country = codes.filter((c) => {return c.code == 'GB'})[0];
|
if (fonud == false) settingsStore.country = scountry_list.value.filter((c) => {return c.code == 'GB'})[0];
|
||||||
console.log("FC=", settingsStore.country);
|
console.log("FC=", settingsStore.country);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ onMounted(fetch_menu);
|
|||||||
<span class="font-extrabold font-mono">Country in which search product</span>
|
<span class="font-extrabold font-mono">Country in which search product</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div class="">
|
||||||
<multiselect @select="selectCurrency" placeholder="All" :close-on-select="true" :multiple="false" v-model="settingsStore.country" :options="scountry_list" label="name" track-by="name">
|
<multiselect @select="selectCurrency" placeholder="All" :close-on-select="true" :multiple="false" v-model="settingsStore.country" :options="scountry_list" label="name" track-by="code">
|
||||||
<template #option="slotProps">
|
<template #option="slotProps">
|
||||||
<span :class="'pl-6 fi fi-' + slotProps.option.code.toLowerCase()">{{ slotProps.option.name }}</span>
|
<span :class="'pl-6 fi fi-' + slotProps.option.code.toLowerCase()">{{ slotProps.option.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ const chart_coutries = computed(() => {
|
|||||||
let countries = [["Country"]];
|
let countries = [["Country"]];
|
||||||
|
|
||||||
for (let i=0; i < settingsStore.ccountry_list.length ; i++) {
|
for (let i=0; i < settingsStore.ccountry_list.length ; i++) {
|
||||||
if (settingsStore.ccountry_list[i].online == (settingsStore.online ? 'Y' : 'N') || settingsStore.online == true)
|
if (settingsStore.ccountry_list[i].offline == (settingsStore.online ? 'N' : 'Y') || settingsStore.online == true)
|
||||||
countries.push([settingsStore.ccountry_list[i].name]);
|
countries.push([settingsStore.ccountry_list[i].name]);
|
||||||
}
|
}
|
||||||
return countries;
|
return countries;
|
||||||
|
|||||||
Reference in New Issue
Block a user