- pagine RISO
This commit is contained in:
@@ -11,46 +11,46 @@ import type {
|
||||
IMyScheda,
|
||||
ISchedaSingola,
|
||||
IText,
|
||||
} from '@src/model';
|
||||
import { IImgGallery, ILabelValue, IMyPage, IOperators } from '@src/model';
|
||||
} from '@/model';
|
||||
import { IImgGallery, ILabelValue, IMyPage, IOperators } from '@/model';
|
||||
import { useGlobalStore } from '@store/globalStore';
|
||||
import { useCatalogStore } from '@store/CatalogStore';
|
||||
|
||||
import { CImgTitle } from '@src/components/CImgTitle';
|
||||
import { CImgPoster } from '@src/components/CImgPoster';
|
||||
import { CMyElemAdd } from '@src/components/CMyElemAdd';
|
||||
import { CTitle } from '@src/components/CTitle/index';
|
||||
import { CImgTitle } from '@/components/CImgTitle';
|
||||
import { CImgPoster } from '@/components/CImgPoster';
|
||||
import { CMyElemAdd } from '@/components/CMyElemAdd';
|
||||
import { CTitle } from '@/components/CTitle/index';
|
||||
import { tools } from '@tools';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { shared_consts } from '@src/common/shared_vuejs';
|
||||
import { LandingFooter } from '@src/components/LandingFooter';
|
||||
import { COpenStreetMap } from '@src/components/COpenStreetMap';
|
||||
import { CCardCarousel } from '@src/components/CCardCarousel';
|
||||
import { CMyPage } from '@src/components/CMyPage';
|
||||
import { CMyPageIntro } from '@src/components/CMyPageIntro';
|
||||
import { CEventsCalendar } from '@src/components/CEventsCalendar';
|
||||
import { CMyEditor } from '@src/components/CMyEditor';
|
||||
import { CMySlider } from '@src/components/CMySlider';
|
||||
import { CMySlideNumber } from '@src/components/CMySlideNumber';
|
||||
import { CMyFieldRec } from '@src/components/CMyFieldRec';
|
||||
import { CSelectImage } from '@src/components/CSelectImage';
|
||||
import { CSelectAnimation } from '@src/components/CSelectAnimation';
|
||||
import { CSelectColor } from '@src/components/CSelectColor';
|
||||
import { CSelectFontSize } from '@src/components/CSelectFontSize';
|
||||
import { CMySize } from '@src/components/CMySize';
|
||||
import { CBorders } from '@src/components/CBorders';
|
||||
import { CMyDimensioni } from '@src/components/CMyDimensioni';
|
||||
import { CMyText } from '@src/components/CMyText';
|
||||
import { CPickColor } from '@src/components/CPickColor';
|
||||
import { shared_consts } from '@/common/shared_vuejs';
|
||||
import { LandingFooter } from '@/components/LandingFooter';
|
||||
import { COpenStreetMap } from '@/components/COpenStreetMap';
|
||||
import { CCardCarousel } from '@/components/CCardCarousel';
|
||||
import { CMyPage } from '@/components/CMyPage';
|
||||
import { CMyPageIntro } from '@/components/CMyPageIntro';
|
||||
import { CEventsCalendar } from '@/components/CEventsCalendar';
|
||||
import { CMyEditor } from '@/components/CMyEditor';
|
||||
import { CMySlider } from '@/components/CMySlider';
|
||||
import { CMySlideNumber } from '@/components/CMySlideNumber';
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec';
|
||||
import { CSelectImage } from '@/components/CSelectImage';
|
||||
import { CSelectAnimation } from '@/components/CSelectAnimation';
|
||||
import { CSelectColor } from '@/components/CSelectColor';
|
||||
import { CSelectFontSize } from '@/components/CSelectFontSize';
|
||||
import { CMySize } from '@/components/CMySize';
|
||||
import { CBorders } from '@/components/CBorders';
|
||||
import { CMyDimensioni } from '@/components/CMyDimensioni';
|
||||
import { CMyText } from '@/components/CMyText';
|
||||
import { CPickColor } from '@/components/CPickColor';
|
||||
|
||||
import MixinMetaTags from '@src/mixins/mixin-metatags';
|
||||
import MixinBase from '@src/mixins/mixin-base';
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags';
|
||||
import MixinBase from '@/mixins/mixin-base';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { emitKeypressEvents } from 'readline';
|
||||
import { costanti } from '@costanti';
|
||||
import objectId from '@src/js/objectId';
|
||||
import { useProducts } from '@src/store/Products';
|
||||
import objectId from '@/js/objectId';
|
||||
import { useProducts } from '@/store/Products';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyEditElem',
|
||||
@@ -829,13 +829,95 @@ export default defineComponent({
|
||||
myel.value.features.push({
|
||||
name: 'Titolo',
|
||||
description: 'sottotitolo',
|
||||
icon: 'fas fa-heading',});
|
||||
icon: 'fas fa-heading',
|
||||
});
|
||||
saveElem();
|
||||
}
|
||||
|
||||
const styleDialogOpen = ref(false);
|
||||
const scriptDialogOpen = ref(false);
|
||||
const tempStyle = ref('');
|
||||
const tempScript = ref('');
|
||||
const originalStyle = ref('');
|
||||
const originalScript = ref('');
|
||||
|
||||
function openStyleDialog() {
|
||||
originalStyle.value = myel.value.container2 || '';
|
||||
tempStyle.value = myel.value.container2 || '';
|
||||
styleDialogOpen.value = true;
|
||||
}
|
||||
|
||||
function openScriptDialog() {
|
||||
originalScript.value = myel.value.container3 || '';
|
||||
tempScript.value = myel.value.container3 || '';
|
||||
scriptDialogOpen.value = true;
|
||||
}
|
||||
|
||||
function updateStylePreview() {
|
||||
myel.value.container2 = tempStyle.value;
|
||||
modifElem();
|
||||
}
|
||||
|
||||
function updateScriptPreview() {
|
||||
myel.value.container3 = tempScript.value;
|
||||
modifElem();
|
||||
}
|
||||
|
||||
function confirmCancel(type: 'style' | 'script') {
|
||||
let modificato = false;
|
||||
|
||||
if (type === 'style') {
|
||||
modificato = myel.value.container2 !== originalStyle.value;
|
||||
} else {
|
||||
modificato = myel.value.container3 !== originalScript.value;
|
||||
}
|
||||
|
||||
if (modificato) {
|
||||
$q.dialog({
|
||||
title: 'Conferma',
|
||||
message: 'Vuoi scartare le modifiche fatte?',
|
||||
cancel: true,
|
||||
persistent: true,
|
||||
}).onOk(() => {
|
||||
if (type === 'style') {
|
||||
myel.value.container2 = originalStyle.value;
|
||||
modifElem();
|
||||
styleDialogOpen.value = false;
|
||||
} else {
|
||||
myel.value.container3 = originalScript.value;
|
||||
modifElem();
|
||||
scriptDialogOpen.value = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
styleDialogOpen.value = false;
|
||||
scriptDialogOpen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function saveStyle() {
|
||||
originalStyle.value = tempStyle.value;
|
||||
styleDialogOpen.value = false;
|
||||
}
|
||||
|
||||
function saveScript() {
|
||||
originalScript.value = tempScript.value;
|
||||
scriptDialogOpen.value = false;
|
||||
}
|
||||
onMounted(mounted);
|
||||
|
||||
return {
|
||||
tempStyle,
|
||||
tempScript,
|
||||
saveScript,
|
||||
saveStyle,
|
||||
confirmCancel,
|
||||
updateScriptPreview,
|
||||
updateStylePreview,
|
||||
styleDialogOpen,
|
||||
scriptDialogOpen,
|
||||
openScriptDialog,
|
||||
openStyleDialog,
|
||||
tools,
|
||||
shared_consts,
|
||||
getArrDisciplines,
|
||||
|
||||
@@ -945,29 +945,22 @@
|
||||
</CMyEditor>
|
||||
|
||||
<q-card-section>
|
||||
<q-input
|
||||
label="Stile Pagina <style>...</style>:"
|
||||
v-model="myel.container2"
|
||||
filled
|
||||
style="max-height: 200px"
|
||||
dense
|
||||
class="scroll-input"
|
||||
v-on:keyup.enter="saveElem"
|
||||
@update:model-value="modifElem"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-input
|
||||
label="Script:"
|
||||
v-model="myel.container3"
|
||||
autogrow
|
||||
filled
|
||||
dense
|
||||
style="max-height: 200px"
|
||||
class="scroll-input"
|
||||
v-on:keyup.enter="saveElem"
|
||||
@update:model-value="modifElem"
|
||||
/>
|
||||
<div class="row items-center q-gutter-sm">
|
||||
<q-btn
|
||||
label="Stile Pagina"
|
||||
:color="myel.container2 ? 'green' : 'grey'"
|
||||
dense
|
||||
@click="openStyleDialog"
|
||||
icon="edit"
|
||||
/>
|
||||
<q-btn
|
||||
label="Script"
|
||||
:color="myel.container3 ? 'secondary' : 'grey'"
|
||||
dense
|
||||
@click="openScriptDialog"
|
||||
icon="code"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2943,6 +2936,120 @@
|
||||
</CMyElemAdd>
|
||||
</q-dialog>
|
||||
</div>
|
||||
|
||||
<!-- Dialog per Stile -->
|
||||
<q-dialog
|
||||
v-model="styleDialogOpen"
|
||||
seamless
|
||||
position="right"
|
||||
>
|
||||
<q-card
|
||||
style="
|
||||
min-width: 600px;
|
||||
max-width: 600px;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<q-card-section class="row items-center q-pb-none">
|
||||
<div class="text-h6">Stile Pagina</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
@click="confirmCancel('style')"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="col scroll">
|
||||
<q-input
|
||||
v-model="tempStyle"
|
||||
type="textarea"
|
||||
filled
|
||||
autogrow
|
||||
rows="10"
|
||||
label="<style>...</style>"
|
||||
@update:model-value="updateStylePreview"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions
|
||||
align="right"
|
||||
class="q-pa-md"
|
||||
>
|
||||
<q-btn
|
||||
flat
|
||||
label="Annulla"
|
||||
@click="confirmCancel('style')"
|
||||
/>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="Ok"
|
||||
@click="saveStyle"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- Dialog per Script -->
|
||||
<q-dialog
|
||||
v-model="scriptDialogOpen"
|
||||
seamless
|
||||
position="right"
|
||||
>
|
||||
<q-card
|
||||
style="
|
||||
min-width: 600px;
|
||||
max-width: 600px;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<q-card-section class="row items-center q-pb-none">
|
||||
<div class="text-h6">Script</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
@click="confirmCancel('script')"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="col scroll">
|
||||
<q-input
|
||||
v-model="tempScript"
|
||||
type="textarea"
|
||||
filled
|
||||
autogrow
|
||||
rows="10"
|
||||
label="JavaScript"
|
||||
@update:model-value="updateScriptPreview"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions
|
||||
align="right"
|
||||
class="q-pa-md"
|
||||
>
|
||||
<q-btn
|
||||
flat
|
||||
label="Annulla"
|
||||
@click="confirmCancel('script')"
|
||||
/>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="Ok"
|
||||
@click="saveScript"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyEditElem.ts"></script>
|
||||
|
||||
Reference in New Issue
Block a user