- Dynamic Pages (MyPage)

- Uploading files to the Server FTP.
This commit is contained in:
Paolo Arena
2019-12-27 12:43:42 +01:00
parent ad8f335d6c
commit ad94721b7d
35 changed files with 355 additions and 232 deletions

View File

@@ -23,6 +23,7 @@ export default class CDateTime extends Vue {
@Prop({ required: false, default: false }) public disable!: boolean
@Prop({ required: false, default: '' }) public bgcolor!: string
@Prop({ required: false, default: false }) public dense: boolean
@Prop({ required: false, default: '5' }) public minuteinterval: boolean
public mystyleicon: string = 'font-size: 1.5rem;'
public showDateTimeScroller: boolean = false
@@ -61,6 +62,7 @@ export default class CDateTime extends Vue {
public changevalueDate() {
if (this.valueDate)
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
// console.log('changevalueDate myvalue', this.myvalue)
}
@Watch('value')
@@ -70,9 +72,10 @@ export default class CDateTime extends Vue {
}
public savetoclose() {
// console.log('Close')
this.saveit = true
this.showDateTimeScroller = false
// this.$emit('savetoclose', this.myvalue, this.valueprec)
this.$emit('savetoclose', this.myvalue, this.valueprec)
}
get scrollerPopupStyle280() {
@@ -100,7 +103,7 @@ export default class CDateTime extends Vue {
else
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
console.log('created myvalue', this.myvalue)
// console.log('created myvalue', this.myvalue)
}
public changeval(newval) {

View File

@@ -48,7 +48,7 @@
bar-color="#2196f3"
text-color="white"
color="primary"
minute-interval="5"
:minute-interval="minuteinterval"
inner-text-color="primary"
inner-color="white"
:style="scrollerPopupStyle280"

View File

@@ -273,7 +273,7 @@ export default class CEventsCalendar extends MixinEvents {
}
get dayHeight() {
if (Screen.height < 400)
if (Screen.height < 410)
return 80
else if (Screen.height < 500)
return 100

View File

@@ -45,9 +45,9 @@ export default class CFacebookFrame extends Vue {
get mywidth() {
let myw = 340
if (tools.getwidth(this) < 400)
if (tools.getwidth(this) < 410)
return myw
if ((tools.getwidth(this) > 400) && (tools.getwidth(this) < 1100))
if ((tools.getwidth(this) > 410) && (tools.getwidth(this) < 1100))
return Math.round((tools.getwidth(this) / 3) - 30)
else
return myw

View File

@@ -1,5 +1,5 @@
<template>
<div class="q-pa-sm">
<div class="q-pa-xs">
<q-table
:data="serverData"
@@ -100,6 +100,7 @@
:row.sync="props.row"
:field="col.field"
:subfield="col.subfield"
minuteinterval="1"
@save="SaveValue"
@show="selItem(props.row, col)"
@showandsave="showandsel">
@@ -142,6 +143,7 @@
<div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
@click="colclicksel = mycol">
<CMyPopupEdit :canEdit="true"
view="field"
:col="mycol"
:showall="true"
:row="rowclicksel"

View File

@@ -49,7 +49,6 @@
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="savefield"></q-toggle>
</div>
<div v-else>
{{ myvalprinted }}
</div>

View File

@@ -10,10 +10,11 @@ import { CDateTime } from '../CDateTime'
import { CMyToggleList } from '../CMyToggleList'
import { CMySelect } from '../CMySelect'
import { CMyEditor } from '../CMyEditor'
import { CGallery } from '../CGallery'
@Component({
name: 'CMyPopupEdit',
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor}
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor, CGallery }
})
export default class CMyPopupEdit extends Vue {
@@ -23,6 +24,8 @@ export default class CMyPopupEdit extends Vue {
@Prop({ required: false, default: '' }) public field
@Prop({ required: false, default: '' }) public subfield
@Prop({ required: false, default: false }) public showall
@Prop({ required: false, default: 'row' }) public view
@Prop({ required: false, default: '5' }) public minuteinterval
public myvalue = ''
@@ -30,6 +33,10 @@ export default class CMyPopupEdit extends Vue {
return tools
}
get isviewfield() {
return this.view === 'field'
}
get db_fieldsTable() {
return fieldsTable
}
@@ -60,7 +67,7 @@ export default class CMyPopupEdit extends Vue {
public SaveValueInt(newVal, valinitial) {
// console.log('SaveValueInt', newVal)
console.log('SaveValueInt', newVal)
// Update value in table memory
if (this.subfield !== '') {
@@ -146,7 +153,7 @@ export default class CMyPopupEdit extends Vue {
public getclassCol(col) {
if (col) {
let mycl = (col.disable) ? '' : 'colmodif'
let mycl = (col.disable || this.isviewfield) ? '' : 'colmodif'
mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
return mycl

View File

@@ -1,148 +1,147 @@
<template>
<div :class="getclassCol(col)">
<div v-if="col.fieldtype === tools.FieldType.date">
<CDateTime
:label="col.label"
class="cursor-pointer"
:valueDate="myvalue"
:readonly="false"
:dense="true"
:canEdit="canEdit"
@savetoclose="SaveValueInt"
@show="OpenEdit">
</CDateTime>
<div v-if="col.fieldtype === tools.FieldType.listimages">
<CGallery :gall="row" :listimages="myvalue" :edit="isviewfield"
@showandsave="Savedb">
</CGallery>
</div>
<div v-else>
<div v-if="col.fieldtype === tools.FieldType.binary">
<CMyChipList
:type="tools.FieldType.binary"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<!-- Show Value -->
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<CMyChipList
:type="tools.FieldType.multiselect"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="Savedb"></q-toggle>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div v-html="visuValByType(myvalue, col, row)">
</div>
</div>
<div v-else>
{{ visuValByType(myvalue, col, row) }}
</div>
<!--<q-select v-model="myvalue"-->
<!--rounded-->
<!--outlined-->
<!--dense-->
<!--:options="db_fieldsTable.getTableJoinByName(col.jointable)"-->
<!--:display-value="db_fieldsTable.getLabelByTable(col.jointable)"-->
<!--emit-value-->
<!--@input="SaveValueInt"-->
<!--&gt;-->
<!--</q-select>-->
<!-- Edit Value -->
<q-popup-edit
v-if="canEdit"
v-model="myvalue"
:disable="col.disable"
:title="col.title"
buttons
@save="SaveValueInt"
@show="OpenEdit">
<span v-if="col.fieldtype === tools.FieldType.date">
<CDateTime
:label="col.label"
class="cursor-pointer"
:valueDate="myvalue"
:readonly="false"
:minuteinterval="minuteinterval"
:dense="true"
:canEdit="canEdit"
@savetoclose="SaveValueInt"
@show="OpenEdit">
</CDateTime>
</span>
<div v-if="col.fieldtype !== tools.FieldType.date">
<div>
<div v-if="col.fieldtype === tools.FieldType.binary">
<CMyChipList
:type="tools.FieldType.binary"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<!-- Show Value -->
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<CMyChipList
:type="tools.FieldType.multiselect"
:value="myvalue"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
@input="Savedb"></q-toggle>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<div v-html="visuValByType(myvalue, col, row)">
<div v-if="col.fieldtype === tools.FieldType.boolean">
<q-checkbox v-model="myvalue" :label="col.title">
</q-checkbox>
{{ visuValByType(myvalue, col, row) }}
</div>
</div>
<div v-else>
{{ visuValByType(myvalue, col, row) }}
</div>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.string">
<q-input v-model="myvalue"
autogrow
@keyup.enter.stop
autofocus>
<q-popup-edit
v-if="canEdit"
v-model="myvalue"
:disable="col.disable"
:title="col.title"
buttons
persistent
@save="SaveValueInt"
@show="OpenEdit">
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.password">
<q-input v-model="myvalue"
type="password"
@keyup.enter.stop
autofocus>
<div v-if="col.fieldtype === tools.FieldType.boolean">
<q-checkbox v-model="myvalue" :label="col.title">
</q-checkbox>
{{ visuValByType(myvalue, col, row) }}
</div>
<div v-else-if="col.fieldtype === tools.FieldType.string">
<q-input v-model="myvalue"
autogrow
@keyup.enter.stop
autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.number">
<q-input v-model="myvalue" type="number"
autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.password">
<q-input v-model="myvalue"
type="password"
@keyup.enter.stop
autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.binary">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.number">
<q-input v-model="myvalue" type="number"
autofocus>
</q-input>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.binary">
<CMyToggleList :label="col.title"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)">
</CMyToggleList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop>
</CMyEditor>
<!--<q-input v-model="myvalue"-->
<!--autofocus-->
<!--@keyup.enter.stop-->
<!--type="textarea"></q-input>-->
</div>
<div v-else-if="col.fieldtype === tools.FieldType.select">
<CMySelect :label="col.title"
:value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)">
</CMyToggleList>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.html">
<CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop>
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:useinput="false">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<q-select
v-model="myvalue"
rounded
outlined
multiple
dense
options-dense
:display-value="db_fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:option-label="db_fieldsTable.getLabelByTable(col.jointable)"
:option-value="db_fieldsTable.getKeyByTable(col.jointable)"
style="min-width: 150px"
@input="changeCol">
</CMyEditor>
<!--<q-input v-model="myvalue"-->
<!--autofocus-->
<!--@keyup.enter.stop-->
<!--type="textarea"></q-input>-->
</div>
<div v-else-if="col.fieldtype === tools.FieldType.select">
<CMySelect :label="col.title"
:value.sync="myvalue"
:optval="db_fieldsTable.getKeyByTable(col.jointable)"
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:useinput="false">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === tools.FieldType.multiselect">
<q-select
v-model="myvalue"
rounded
outlined
multiple
dense
options-dense
:display-value="db_fieldsTable.getTitleByTable(col.jointable)"
emit-value
map-options
:options="db_fieldsTable.getTableJoinByName(col.jointable)"
:option-label="db_fieldsTable.getLabelByTable(col.jointable)"
:option-value="db_fieldsTable.getKeyByTable(col.jointable)"
style="min-width: 150px"
@input="changeCol">
</q-select>
</div>
</q-select>
</div>
</q-popup-edit>
</q-popup-edit>
</div>
</div>
</div>
</template>
<script lang="ts" src="./CMyPopupEdit.ts">

View File

@@ -14,9 +14,9 @@
</div>
<div v-else>
<div class="q-my-md">
<p class="text-subtitle2 text-center">
<p v-if="urlmap" class="text-subtitle2 text-center">
<span v-html="title"></span>
- <a href="urlmap" target="_blank" class="text-black">Apri Mappa</a>
- <a :href="urlmap" target="_blank" class="text-black">Apri Mappa</a>
</p>
<a :href="urlmap" target="_blank">
<q-img :src="`statics/` + imgmap" class="imgautosize" alt="my map">

View File

@@ -17,6 +17,7 @@ import router from '@router'
import globalroutines from '../../globalroutines/index'
import { ICategory } from '../../model'
import { static_data } from '../../db/static_data'
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
@@ -39,6 +40,10 @@ export default class CSignIn extends Vue {
password: process.env.TEST_PASSWORD || ''
}
get static_data() {
return static_data
}
public created() {
this.$v.$reset()

View File

@@ -55,7 +55,7 @@
:disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn>
</div>
<div align="center" style="margin-top:10px;">
<div v-if="static_data.functionality.ENABLE_REGISTRATION" align="center" style="margin-top:10px;">
<q-btn flat rounded size="md" color="primary" to="/signup">{{$t('reg.submit')}}
</q-btn>
</div>

View File

@@ -0,0 +1,3 @@
.myshad {
text-shadow: .125rem .125rem .125rem darkgray;
}

View File

@@ -26,6 +26,23 @@ import { Screen } from 'quasar'
export default class CTitleBanner extends Vue {
@Prop({ required: true}) public title: string
@Prop({ required: false, default: 'bg-primary' }) public bgcolor: string
@Prop({ required: false, default: 'primary' }) public color: string
@Prop({ required: false, default: 'text-white' }) public clcolor: string
@Prop({ required: false, default: '' }) public mystyle: string
@Prop({ required: false, default: '' }) public myclass: string
@Prop({ required: false, default: '' }) public myclasstext: string
@Prop({ required: false, default: '' }) public icon: string
@Prop({ required: false, default: true }) public visible: boolean
public myvisible: boolean = true
public mounted() {
this.myvisible = this.visible
}
get iconopen() {
if (!this.myvisible)
return 'fas fa-chevron-down q-icon q-expansion-item__toggle-icon q-focusable '
else
return 'fas fa-chevron-down q-icon q-expansion-item__toggle-icon q-focusable rotate-180'
}
}

View File

@@ -1,11 +1,27 @@
<template>
<div>
<q-banner
class="q-my-md"
rounded dense :class="bgcolor+` text-white`"
:color="color+` q-title`" style="text-align: center;">
<span class="mybanner">{{title}}</span>
inline-actions
rounded dense
:class="bgcolor+` q-my-md `+clcolor+ ` ` + myclass"
style="text-align: center; "
@click="myvisible = !myvisible"
>
<template v-slot:avatar>
<q-icon :name="icon" color="white" />
</template>
<template v-slot:action>
<q-icon :name="iconopen" color="white" />
</template>
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
</q-banner>
<q-slide-transition>
<div v-show="myvisible">
<slot></slot>
</div>
</q-slide-transition>
</div>
</template>

View File

@@ -137,13 +137,6 @@ $textcol_scuro: darkblue;
font-size: 0.6rem;
}
.carousel_img_3 {
//background-image: url(../../statics/images/cibo_sano.jpg);
background-size: 620px 620px !important;
background-position: 50% top !important;
background-repeat: no-repeat !important;
}
}
.custom-caption {

View File

@@ -44,7 +44,7 @@
</div>
</div>
<div class="text-center">
<div v-if="getValDb('URLMAP', false)" class="text-center">
<span v-html="getValDb('MAP_TITLE', false)"></span>
<br>
<a :href="getValDb('URLMAP', false)" target="_blank" class="footer_link">Apri Mappa</a>
@@ -61,7 +61,6 @@
<div class="q-mt-xs mycontacts">
<p class="mycontacts_title">{{$t('homepage.titlecontatti')}}</p>
<div class="mycontacts_text">
<i v-if="getValDb('MAIN_EMAIL', false)" aria-hidden="true"
class="q-icon fas fa-envelope q-mx-sm"></i>

View File

@@ -7,7 +7,14 @@
font-weight: 350;
}
.q-toolbar__title{
padding: 0 12px;
}
@media screen and (max-width: 600px) {
.q-toolbar__title{
padding: 0;
}
.layout-padding {
padding: 1.5em .5em;
}

View File

@@ -308,7 +308,7 @@ export default class Header extends Vue {
}
get getappname() {
return tools.getappname(this)
return tools.getappname(this, tools.isMobile())
}
public toggleanimation() {

View File

@@ -34,3 +34,4 @@ export * from './Shen/CTesseraElettronica'
export * from './CGoogleMap'
export * from './COpenStreetMap'
export * from './CTitleBanner'
export * from './CGallery'