Webpage Editor functionality
This commit is contained in:
0
src/rootgen/admin/editElems/editElems.scss
Executable file
0
src/rootgen/admin/editElems/editElems.scss
Executable file
67
src/rootgen/admin/editElems/editElems.ts
Executable file
67
src/rootgen/admin/editElems/editElems.ts
Executable file
@@ -0,0 +1,67 @@
|
||||
import { defineComponent, ref, onMounted, computed, watch } from 'vue'
|
||||
|
||||
import { CImgText } from '../../../components/CImgText/index'
|
||||
import { CCard } from '@/components/CCard'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||
|
||||
import { colmyelems } from '@src/store/Modules/fieldsTable'
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { IMyPage } from 'model'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'editElems',
|
||||
setup() {
|
||||
|
||||
const { setmeta } = MixinMetaTags()
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const arrPages = ref([] as any[])
|
||||
|
||||
const pageSel = ref('')
|
||||
|
||||
watch(() => pageSel.value, (newval: any, oldval) => {
|
||||
tools.setCookie('s_elems', newval)
|
||||
})
|
||||
|
||||
const filtercustom = computed(() => [{ path: pageSel.value }] )
|
||||
|
||||
function mounted() {
|
||||
|
||||
arrPages.value = []
|
||||
arrPages.value.push({label: '[Vuoto]', path: ''})
|
||||
for (const page of globalStore.mypage) {
|
||||
|
||||
const rec = {
|
||||
// @ts-ignore
|
||||
label: page.title,
|
||||
// @ts-ignore
|
||||
value: page.path
|
||||
}
|
||||
arrPages.value.push(rec)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// filtercustom.value = [{ userId: userStore.my._id }]
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
pageSel.value = tools.getCookie('s_elems', '')
|
||||
|
||||
return {
|
||||
colmyelems,
|
||||
setmeta,
|
||||
arrPages,
|
||||
pageSel,
|
||||
filtercustom,
|
||||
}
|
||||
},
|
||||
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec }
|
||||
})
|
||||
38
src/rootgen/admin/editElems/editElems.vue
Executable file
38
src/rootgen/admin/editElems/editElems.vue
Executable file
@@ -0,0 +1,38 @@
|
||||
ù<template>
|
||||
<CMyPage title="Elementi Pagine" imgbackground="images/calendario_eventi.jpg" sizes="max-height: 120px">
|
||||
<span>{{
|
||||
setmeta({
|
||||
title: 'Pagina Home',
|
||||
description: '',
|
||||
keywords: '',
|
||||
})
|
||||
}}
|
||||
</span>
|
||||
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<CTitleBanner title="Elementi Pagine"></CTitleBanner>
|
||||
|
||||
<q-select rounded outlined v-model="pageSel"
|
||||
:options="arrPages"
|
||||
label="Pagina" emit-value map-options>
|
||||
|
||||
</q-select>
|
||||
<CGridTableRec
|
||||
prop_mytable="myelems"
|
||||
prop_mytitle="Elementi Pagina"
|
||||
:prop_mycolumns="colmyelems"
|
||||
:filtercustom="filtercustom"
|
||||
prop_colkey="title"
|
||||
nodataLabel="Nessun elemento di Modifica Elementi"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
|
||||
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
</CMyPage>
|
||||
</template>
|
||||
<script lang="ts" src="./editElems.ts">
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'editElems.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user