This commit is contained in:
Surya Paolo
2022-11-12 11:52:20 +01:00
parent f3a2f2491e
commit 3c20038c68
79 changed files with 7630 additions and 37 deletions

View File

@@ -462,3 +462,15 @@ body.mobile .landing:before {
border: #11f609 solid 2px;
cursor: pointer;
}
.align_center {
text-align: center;
}
.align_right {
text-align: right;
}
.align_left {
text-align: left;
}

View File

@@ -9,7 +9,7 @@ import { CImgTitle } from '../CImgTitle/index'
import { CTitle } from '@/components/CTitle/index'
import { tools } from '@store/Modules/tools'
import { shared_consts } from '@/common/shared_vuejs'
import LandingFooter from '@/components/LandingFooter/LandingFooter'
import { LandingFooter } from '@/components/LandingFooter'
import { COpenStreetMap } from '@src/components/COpenStreetMap'
import { CCardCarousel } from '@src/components/CCardCarousel'
import { CMyPage } from '@src/components/CMyPage'
@@ -22,6 +22,7 @@ import MixinMetaTags from '@/mixins/mixin-metatags'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
export default defineComponent({
name: 'CMyElem',
components: { CImgTitle, CTitle, LandingFooter, CEventsCalendar, CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec },
@@ -44,7 +45,7 @@ export default defineComponent({
type: Boolean,
required: false,
default: false,
}
},
},
setup(props) {
const globalStore = useGlobalStore()
@@ -155,6 +156,26 @@ export default defineComponent({
}
}
function getClass() {
let mycl = ''
if (props.myelem.align === shared_consts.ALIGNTYPE.CEHTER) {
mycl += ' align_center'
} else if (props.myelem.align === shared_consts.ALIGNTYPE.RIGHT) {
mycl += ' align_right'
} else if (props.myelem.align === shared_consts.ALIGNTYPE.LEFT) {
mycl += ' align_left'
}
return mycl
}
function showFit() {
if (props.myelem.type)
return [shared_consts.ELEMTYPE.TEXT].includes(props.myelem.type)
else
return false
}
onMounted(mounted)
return {
@@ -178,6 +199,8 @@ export default defineComponent({
enableEdit,
enableAdd,
clickOnElem,
getClass,
showFit,
}
},

View File

@@ -31,6 +31,30 @@
type="number"
>
</q-input>
<q-select
v-if="enableEdit"
rounded outlined v-model="myel.align"
:options="tools.SelectListAlign"
@update:model-value="modifElem"
dense
label="Allinea" emit-value map-options>
</q-select>
<q-select
v-if="enableEdit"
rounded outlined v-model="myel.class"
:options="tools.SelectListClass"
@update:model-value="modifElem"
dense
label="Classe" emit-value map-options>
</q-select>
<q-select
v-if="enableEdit && showFit"
rounded outlined v-model="myel.fit"
:options="tools.SelectListFit"
@update:model-value="modifElem"
dense
label="Fit" emit-value map-options>
</q-select>
<q-space/>
<q-btn
icon="fas fa-trash-alt"
@@ -56,10 +80,11 @@
flat
icon="fas fa-plus"
color="positive"
@click="addNewElem(myelem.order-10)">
@click="addNewElem(myel.order-10)">
</q-btn>
</q-bar>
<div v-if="myel.type === shared_consts.ELEMTYPE.TEXT">
<div v-if="enableEdit">
<q-input
@@ -74,11 +99,53 @@
</div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``)"
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">{{ myel.container }}
</div>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.CARD">
<q-card class="my-card" flat bordered>
<q-img
:src="myel.img"
/>
<q-card-section>
<div class="text-overline text-orange-9">{{ myel.container }}</div>
<div class="text-h5 q-mt-sm q-mb-xs">{{ myel.container2 }}</div>
<div class="text-caption text-grey">
{{ myel.container3 }}
</div>
</q-card-section>
<!--<q-card-actions>
<q-btn flat color="dark" label="Share"/>
<q-btn flat color="primary" label="Book"/>
<q-space/>
<q-btn
color="grey"
round
flat
dense
:icon="expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down'"
@click="expanded = !expanded"
/>
</q-card-actions>-->
<q-slide-transition>
<div v-show="expanded">
<q-separator/>
<q-card-section class="text-subitle2">
{{ lorem }}
</q-card-section>
</div>
</q-slide-transition>
</q-card>
</div>
<div v-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
<div v-if="enableEdit">
<q-input
@@ -93,7 +160,7 @@
</div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``)"
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
:style="`margin: ` + myel.size">&nbsp;
</div>
@@ -112,7 +179,7 @@
</div>
<div>
<div
:class="myel.class + (editOn ? ` clEdit` : ``)"
:class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CTitle
:imgbackground="myel.imgback"
@@ -144,7 +211,7 @@
</div>
<div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CImgTitle v-if="myel.container" :src="myel.container" :title="myel.title">
</CImgTitle>
@@ -172,7 +239,7 @@
</div>
<div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem"
v-html="myel.containerHtml"></div>
</div>
@@ -190,18 +257,16 @@
<div class="row">
<q-input
label="Width:"
type="number"
@update:model-value="modifElem"
v-model="myel.width"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
<q-input
label="Height:"
type="number"
@update:model-value="modifElem"
v-model="myel.height"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
>
@@ -209,9 +274,9 @@
</div>
</div>
<div class="text-center">
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-img :src="myel.container" class="img" :width="myel.width.toString()" :height="myel.height.toString()"></q-img>
<q-img :src="myel.container" :fit="myel.fit" class="img" :width="myel.widthimg ? myel.widthimg: undefined" :height="myel.heightimg ? myel.heightimg : undefined"></q-img>
</div>
</div>
</div>
@@ -235,14 +300,18 @@
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-video v-if="!!rec.container" :src="rec.container" :ratio="rec.ratio">
</q-video>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.FOOTER">
<LandingFooter></LandingFooter>
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<LandingFooter></LandingFooter>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.PAGE">
<div v-if="enableEdit" class="row">
@@ -255,7 +324,7 @@
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CMyPage :mypath="myel.container">&nbsp;</CMyPage>
</div>
@@ -266,6 +335,7 @@
label="NomeFile Img:"
@update:model-value="modifElem"
v-model="myel.container"
debounce="1000"
filled
v-on:keyup.enter="saveElem"
>
@@ -274,6 +344,7 @@
label="Width:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.widthimg"
filled
v-on:keyup.enter="saveElem"
@@ -283,6 +354,7 @@
label="Height:"
type="number"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.heightimg"
filled
v-on:keyup.enter="saveElem"
@@ -291,13 +363,14 @@
<q-input
label="Link:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.link"
filled
v-on:keyup.enter="saveElem"
>
</q-input>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<CMyPageIntro :mypath="myel.container" :maxheightimg="myel.heightimg" :maxwidthimg="myel.widthimg" :link="myel.link"></CMyPageIntro>
</div>
@@ -332,6 +405,7 @@
<q-input
label="Secondi tra un'immagine e l'altra:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.container2"
type="number"
filled
@@ -355,7 +429,7 @@
</q-toggle>
</div>
<div :class="myel.class + (editOn ? ` clEdit` : ``)"
<div :class="myel.class + (editOn ? ` clEdit` : ``) + getClass()"
@click="clickOnElem">
<q-carousel
@@ -364,6 +438,7 @@
:autoplay="myel.container2 ? (myel.container2 * 1000) : 8000"
v-model="slide2"
arrows
:fit="myel.fit"
:thumbnails="myel.parambool2"
infinite
:height="myel.height ? myel.height.toString() : 600">
@@ -448,6 +523,7 @@
<q-input
label="Visualizza ultimi N eventi:"
@update:model-value="modifElem"
debounce="1000"
v-model="myel.number"
filled
v-on:keyup.enter="saveElem"
@@ -487,7 +563,6 @@
@click="saveElem(true)">
</q-btn>
</div>
</div>
</template>

View File

@@ -8,12 +8,12 @@
>
</q-toggle>
<q-toggle v-if="tools.isManager()"
<!-- <q-toggle v-if="tools.isManager()"
v-model="addOn"
icon="fas fa-plus"
>
</q-toggle>
</q-toggle>-->
</q-toolbar>

View File

@@ -4,9 +4,9 @@
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="!!rec.img1" class="text-center">
<q-btn v-if="link" @click="openclick">
<q-img :src="rec.img1" :height="maxheightimg + `px`" :width="maxwidthimg + `px`" fit="fill"></q-img>
<q-img :src="rec.img1" :height="maxheightimg" :width="maxwidthimg" fit="fill"></q-img>
</q-btn>
<q-img v-else :src="rec.img1" :height="maxheightimg + `px`" :width="maxwidthimg + `px`" fit="fill" @click="openclick"></q-img>
<q-img v-else :src="rec.img1" :height="maxheightimg" :width="maxwidthimg" fit="fill" @click="openclick"></q-img>
</div>
<div v-if="!!rec.content" v-html="rec.content"></div>