Online search
This commit is contained in:
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Log;
|
|||||||
|
|
||||||
class IkeaProductsController extends Controller
|
class IkeaProductsController extends Controller
|
||||||
{
|
{
|
||||||
public function search(Request $request, string $field, string $text, ?string $country = '', $online = false)
|
public function search(Request $request, string $field, string $text, ?string $country = '')
|
||||||
{
|
{
|
||||||
return IkeaProducts::search($field, $text, $country);
|
return IkeaProducts::search($field, $text, $country);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,11 +215,6 @@ const sleep = (ms) => {
|
|||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSelectCode = () => {
|
|
||||||
if (settingsStore.field.value == 'code') {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const fetch = async () => {
|
const fetch = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(route("ccountry.active"));
|
const response = await axios.get(route("ccountry.active"));
|
||||||
@@ -317,7 +312,7 @@ const async_search = async () => {
|
|||||||
|
|
||||||
console.log('SETTINGS',settingsStore.country);
|
console.log('SETTINGS',settingsStore.country);
|
||||||
console.log('URL',route("products.search", ['all', settingsStore.text, country]));
|
console.log('URL',route("products.search", ['all', settingsStore.text, country]));
|
||||||
const response = await axios.get(route("products.search", ['all', settingsStore.text, country, settingsStore.online]));
|
const response = await axios.get(route("products.search", ['all', settingsStore.text, country]));
|
||||||
|
|
||||||
options_items.value = response.data.map((i) => {
|
options_items.value = response.data.map((i) => {
|
||||||
return {
|
return {
|
||||||
@@ -333,9 +328,7 @@ const async_search = async () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
console.log("VALUES=", options_items.value);
|
console.log("VALUES=", options_items.value);
|
||||||
if (settingsStore.field.value == 'code') {
|
|
||||||
showRow({'code': settingsStore.text});
|
|
||||||
}
|
|
||||||
productsCriteria.value = null;
|
productsCriteria.value = null;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const response = await Swal.fire({
|
const response = await Swal.fire({
|
||||||
@@ -472,7 +465,7 @@ const selectedRowClassNameFunction = (item) => {
|
|||||||
}}</a>
|
}}</a>
|
||||||
</template>
|
</template>
|
||||||
</EasyTable>
|
</EasyTable>
|
||||||
<div v-if="settingsStore.field == 'code' && settingsStore.online == true">Online</div>
|
<div v-if="settingsStore.online == true">Online</div>
|
||||||
<div v-else-if="'LAST_REFRESH_TIME' in settingsStore.settings">Last Refresh Time: {{ settingsStore.settings["LAST_REFRESH_TIME"] }}</div>
|
<div v-else-if="'LAST_REFRESH_TIME' in settingsStore.settings">Last Refresh Time: {{ settingsStore.settings["LAST_REFRESH_TIME"] }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -493,10 +486,10 @@ const selectedRowClassNameFunction = (item) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-2" >
|
<div class="ml-2" >
|
||||||
<div v-if="settingsStore.field == 'code'">
|
<div>
|
||||||
<span class="font-extrabold font-mono">Online:</span>
|
<span class="font-extrabold font-mono">Online:</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="settingsStore.field == 'code'">
|
<div>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const settingsStore = reactive({
|
|||||||
countries: "",
|
countries: "",
|
||||||
country: "",
|
country: "",
|
||||||
field: "",
|
field: "",
|
||||||
|
online: false,
|
||||||
text: "",
|
text: "",
|
||||||
currency: "EUR",
|
currency: "EUR",
|
||||||
online: false,
|
online: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user