feat: Admin/Items show only isActive #99
|
@ -22,8 +22,8 @@ const query = `SELECT i.id, i.longName, i.size, i.category,
|
||||||
LEFT JOIN image im
|
LEFT JOIN image im
|
||||||
ON im.collectionFk = 'catalog'
|
ON im.collectionFk = 'catalog'
|
||||||
AND im.name = i.image
|
AND im.name = i.image
|
||||||
WHERE i.longName LIKE CONCAT('%', #search, '%')
|
WHERE (i.longName LIKE CONCAT('%', #search, '%')
|
||||||
OR i.id = #search
|
OR i.id = #search) AND i.isActive = 1
|
||||||
|
|||||||
ORDER BY i.longName LIMIT 50`;
|
ORDER BY i.longName LIMIT 50`;
|
||||||
|
|
||||||
const onSearch = data => (items.value = data || []);
|
const onSearch = data => (items.value = data || []);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, inject } from 'vue';
|
import { ref, onMounted, inject } from 'vue';
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
|
||||||
const jApi = inject('jApi');
|
const jApi = inject('jApi');
|
||||||
const news = ref([]);
|
const news = ref([]);
|
||||||
const showPreview = ref(false);
|
const showPreview = ref(false);
|
||||||
|
@ -14,6 +13,15 @@ const fetchData = async () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showImagePreview = src => {
|
||||||
|
showPreview.value = true;
|
||||||
|
selectedImageSrc.value = src;
|
||||||
|
};
|
||||||
|
const hideImagePreview = src => {
|
||||||
|
showPreview.value = false;
|
||||||
|
selectedImageSrc.value = null;
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => await fetchData());
|
onMounted(async () => await fetchData());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -22,7 +30,14 @@ onMounted(async () => await fetchData());
|
||||||
<div class="q-pa-sm row items-start">
|
<div class="q-pa-sm row items-start">
|
||||||
<div class="new-card q-pa-sm" v-for="myNew in news" :key="myNew.id">
|
<div class="new-card q-pa-sm" v-for="myNew in news" :key="myNew.id">
|
||||||
<QCard>
|
<QCard>
|
||||||
<VnImg :id="myNew.image" storage="news" />
|
<QImg
|
||||||
|
:src="`${$app.imageUrl}/news/full/${myNew.image}`"
|
||||||
|
@click="
|
||||||
|
showImagePreview(
|
||||||
|
`${$app.imageUrl}/news/full/${myNew.image}`
|
||||||
|
)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<div class="text-h5">
|
<div class="text-h5">
|
||||||
|
@ -46,7 +61,7 @@ onMounted(async () => await fetchData());
|
||||||
>
|
>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</div>
|
</div>
|
||||||
<QDialog v-model="showPreview" @hide="selectedImageSrc = ''">
|
<QDialog v-model="showPreview" @hide="hideImagePreview">
|
||||||
<QImg :src="selectedImageSrc" />
|
<QImg :src="selectedImageSrc" />
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue
Cambiar:
AND i.isActive = 1 → AND i.isActive
Totalmente de acuerdo, porque esto es SQL tal cual, no es la utilidad web que se hizo para este proyecto
Fet!
85296109ca