- Aggiornati margini.
- Cataloghi: Export ed Import di una pagine ed i suoi elementi !
This commit is contained in:
0
src/components/CText/CText.scss
Executable file
0
src/components/CText/CText.scss
Executable file
61
src/components/CText/CText.ts
Executable file
61
src/components/CText/CText.ts
Executable file
@@ -0,0 +1,61 @@
|
||||
import {
|
||||
PropType,
|
||||
computed,
|
||||
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { ICatalogo, IMyScheda, IProduct, ISchedaSingola, IText } from '@src/model'
|
||||
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CText',
|
||||
props: {
|
||||
rectext: {
|
||||
type: Object as PropType<IText>,
|
||||
required: true,
|
||||
},
|
||||
myproduct: {
|
||||
type: Object as PropType<IProduct>,
|
||||
required: true,
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: true,
|
||||
},
|
||||
scheda: {
|
||||
type: Object as PropType<IMyScheda>,
|
||||
required: true,
|
||||
},
|
||||
show_at_right: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
|
||||
const getTesto = computed(() => {
|
||||
return products.replaceKeyWordsByProduct(
|
||||
props.optcatalogo,
|
||||
props.myproduct,
|
||||
props.rectext,
|
||||
)
|
||||
})
|
||||
|
||||
return {
|
||||
tools,
|
||||
getTesto,
|
||||
globalStore,
|
||||
costanti,
|
||||
}
|
||||
},
|
||||
})
|
||||
44
src/components/CText/CText.vue
Executable file
44
src/components/CText/CText.vue
Executable file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<!-- A DESTRA -->
|
||||
<span
|
||||
v-if="
|
||||
getTesto && rectext.font?.posiz_text === costanti.POSIZ_TESTO.A_DESTRA
|
||||
"
|
||||
:class="'flex flex-col justify-between'"
|
||||
:style="{
|
||||
width: rectext.font?.perc_text ?? '50%',
|
||||
...( rectext.size && rectext.size.height ? { height: tools.adjustSize(optcatalogo, rectext.size.height) } : {}),
|
||||
marginTop: '0',
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': rectext.font?.line_height,
|
||||
}"
|
||||
>
|
||||
<div v-html="getTesto"></div>
|
||||
<slot></slot>
|
||||
</span>
|
||||
|
||||
<!-- IN BASSO -->
|
||||
<span
|
||||
v-else-if="
|
||||
getTesto && rectext.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
"
|
||||
:class="{ 'flex-details_and_barcode' : show_at_right }"
|
||||
:style="{
|
||||
width: rectext.font?.perc_text ?? '50%',
|
||||
...( rectext.size && rectext.size.height ? { height: tools.adjustSize(optcatalogo, rectext.size.height) } : {}),
|
||||
marginTop: '0rem',
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': rectext.font?.line_height,
|
||||
'gap': show_at_right && scheda.barcode.size?.gap ? tools.adjustSize(optcatalogo, scheda.barcode.size?.gap) : ''
|
||||
}"
|
||||
>
|
||||
<div v-html="getTesto"></div>
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CText.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CText.scss';
|
||||
</style>
|
||||
1
src/components/CText/index.ts
Executable file
1
src/components/CText/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CText } from './CText.vue'
|
||||
Reference in New Issue
Block a user