[pricelist][fix] cordova loading pictures
This commit is contained in:
parent
52ae8fce29
commit
c76da59290
|
@ -1,7 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="de.wu5.flaschengeist" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<widget id="de.wu5.flaschengeist" version="2.0.0-alpha.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<name>Flaschengeist</name>
|
||||
<description>Dynamischen Managementsystem für Studentenclubs</description>
|
||||
<description>Modular student club administration system</description>
|
||||
<author email="dev@cordova.apache.org" href="http://cordova.io">
|
||||
Apache Cordova Team
|
||||
</author>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* eslint-disable */
|
||||
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
||||
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
||||
import 'quasar/dist/types/feature-flag';
|
||||
import "quasar/dist/types/feature-flag";
|
||||
|
||||
declare module 'quasar/dist/types/feature-flag' {
|
||||
declare module "quasar/dist/types/feature-flag" {
|
||||
interface QuasarFeatureFlags {
|
||||
cordova: true;
|
||||
}
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
<q-card>
|
||||
<q-img
|
||||
style="max-height: 256px"
|
||||
:src="
|
||||
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=400` : 'no-image.svg'
|
||||
"
|
||||
:src="image(props.row.uuid)"
|
||||
>
|
||||
<div
|
||||
v-if="!public && !nodetails && editable"
|
||||
|
@ -158,6 +156,7 @@ import { sort } from '../utils/sort';
|
|||
import { DeleteObjects } from 'src/plugins/pricelist/utils/utils';
|
||||
import { hasPermission } from 'src/utils/permission';
|
||||
import { PERMISSIONS } from 'src/plugins/pricelist/permissions';
|
||||
import config from 'src/config';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CalculationTable',
|
||||
|
@ -476,6 +475,13 @@ export default defineComponent({
|
|||
return false;
|
||||
}
|
||||
|
||||
function image(uuid: string | undefined) {
|
||||
if (uuid) {
|
||||
return `${config.baseURL}/pricelist/picture/${uuid}?size=256`;
|
||||
}
|
||||
return 'no-image.svg';
|
||||
}
|
||||
|
||||
return {
|
||||
drinks: computed(() => store.drinks),
|
||||
pagination,
|
||||
|
@ -502,6 +508,7 @@ export default defineComponent({
|
|||
newDrink,
|
||||
hasPermission,
|
||||
PERMISSIONS,
|
||||
image
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
<q-img
|
||||
style="max-height: 256px"
|
||||
loading="lazy"
|
||||
:src="
|
||||
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=256` : 'no-image.svg'
|
||||
"
|
||||
:src="image(props.row.uuid)"
|
||||
placeholder-src="no-image.svg"
|
||||
>
|
||||
<div class="absolute-bottom-right justify-end">
|
||||
|
@ -62,6 +60,7 @@ import BuildManualVolume from '../components/BuildManual/BuildManualVolume.vue';
|
|||
import SearchInput from '../components/SearchInput.vue';
|
||||
import { filter, Search } from '../utils/filter';
|
||||
import { sort } from '../utils/sort';
|
||||
import config from 'src/config';
|
||||
export default defineComponent({
|
||||
name: 'Reciepts',
|
||||
components: { BuildManual, BuildManualVolume, SearchInput },
|
||||
|
@ -155,12 +154,19 @@ export default defineComponent({
|
|||
|
||||
const search = ref<Search>({ value: '', key: '', label: '' });
|
||||
const search_keys = computed(() => columns_drinks.filter((column) => column.filterable));
|
||||
function image(uuid: string | undefined) {
|
||||
if (uuid) {
|
||||
return `${config.baseURL}/pricelist/picture/${uuid}?size=256`;
|
||||
}
|
||||
return 'no-image.svg';
|
||||
}
|
||||
return {
|
||||
drinks,
|
||||
options: [...columns_drinks, ...columns_volumes, ...columns_prices],
|
||||
search,
|
||||
filter,
|
||||
search_keys,
|
||||
image,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue