Web Editor home made

This commit is contained in:
Surya Paolo
2022-11-17 08:10:43 +01:00
parent 711f1b515d
commit 495abc33be
77 changed files with 1742 additions and 1771 deletions

View File

@@ -28,15 +28,21 @@ import { useI18n } from '@/boot/i18n'
export default defineComponent({
name: 'CMyElem',
components: { CImgTitle, CTitle, LandingFooter, CEventsCalendar,
components: {
CImgTitle, CTitle, LandingFooter, CEventsCalendar,
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
CSelectColor, CSelectFontSize },
CSelectColor, CSelectFontSize
},
emits: ['selElemClick'],
props: {
myelem: {
type: Object as PropType<IMyElem>,
required: true,
},
selElem: {
type: Object as PropType<IMyElem>,
required: false,
},
path: {
type: String,
required: false,
@@ -70,7 +76,7 @@ export default defineComponent({
const enableEdit = ref(false)
const enableAdd = ref(true)
const neworder = ref(<number|undefined>0)
const neworder = ref(<number | undefined>0)
const myel = toRef(props, 'myelem')
const newtype = ref(<any>'')
@@ -157,7 +163,7 @@ export default defineComponent({
}
function modifElem(value: any) {
function modifElem() {
disableSave.value = false
}
@@ -171,6 +177,7 @@ export default defineComponent({
function clickOnElem() {
if (props.editOn) {
enableEdit.value = true
console.log('selElemClick', props.myelem)
emit('selElemClick', props.myelem)
}
}
@@ -188,13 +195,21 @@ export default defineComponent({
if (props.myelem.class2)
mycl += ' ' + props.myelem.class2
if (props.selElem && props.editOn) {
if (props.myelem._id === props.selElem._id)
mycl += ' selectedElem'
}
return mycl
}
function getImgFileByElem(elem: IMyElem, reccard?: IMyCard) {
if (elem) {
if (elem.type === shared_consts.ELEMTYPE.CARD) {
return 'upload/pages/' + elem.path + '/' + reccard!.imagefile
if (reccard?.imagefile)
return 'upload/pages/' + elem.path + '/' + reccard.imagefile
else
return ''
} else if (elem.type === shared_consts.ELEMTYPE.IMAGE) {
return 'upload/pages/' + elem.path + '/' + elem.container
} else {