CDateTime - CGallery
This commit is contained in:
BIN
public/upload/gallery/vendemmia.jpeg
Normal file
BIN
public/upload/gallery/vendemmia.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -7,7 +7,7 @@ export default defineComponent({
|
||||
name: 'CDate',
|
||||
props: {
|
||||
mydate: {
|
||||
type: Object as PropType<Date>,
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
label: {
|
||||
@@ -62,11 +62,11 @@ export default defineComponent({
|
||||
const mystyleicon = ref('font-size: 1.5rem;')
|
||||
|
||||
watch(() => props.mydate, (value, oldval) => {
|
||||
valueInternal.value = value
|
||||
valueInternal.value = tools.getstrdateToDate(value)
|
||||
})
|
||||
|
||||
function created() {
|
||||
valueInternal.value = props.mydate
|
||||
valueInternal.value = tools.getstrdateToDate(props.mydate)
|
||||
|
||||
if (props.data_class !== '') {
|
||||
mystyleicon.value = 'font-size: 1rem;'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineComponent, onMounted, PropType, ref, toRef, watch } from 'vue'
|
||||
import { defineComponent, ref, toRef, watch } from 'vue'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import { date, useQuasar } from 'quasar'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useCalendarStore } from '@store/CalendarStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
@@ -10,14 +10,14 @@ export default defineComponent({
|
||||
name: 'CDate',
|
||||
props: {
|
||||
value: {
|
||||
type: Object as PropType<Date>,
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
default: '',
|
||||
},
|
||||
valueDate: {
|
||||
type: Object as PropType<Date>,
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
default: '',
|
||||
},
|
||||
data_class: {
|
||||
type: String,
|
||||
@@ -67,9 +67,9 @@ export default defineComponent({
|
||||
|
||||
const showDateTimeScroller = ref(false)
|
||||
const saveit = ref(false)
|
||||
const myvalue = ref(new Date())
|
||||
const valueprec = ref(new Date())
|
||||
const myvalueDate = toRef(props, 'valueDate')
|
||||
const myvalue = ref('')
|
||||
const valueprec = ref('')
|
||||
// const myvalueDate = toRef(props, 'valueDate')
|
||||
|
||||
function getclass() {
|
||||
return 'calendar_comp ' + props.data_class
|
||||
@@ -79,9 +79,9 @@ export default defineComponent({
|
||||
// console.log('Opening', 'myvalue', myvalue, 'value', value)
|
||||
saveit.value = false
|
||||
valueprec.value = myvalue.value
|
||||
if (myvalue.value === undefined) {
|
||||
myvalueDate.value = new Date()
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
if (myvalue.value === '') {
|
||||
// myvalueDate.value = tools.getstrYYMMDDDateTime(new Date())
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(new Date())
|
||||
}
|
||||
// console.log('Opening', myvalueDate, myvalue)
|
||||
emit('show')
|
||||
@@ -97,9 +97,10 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => myvalueDate.value, (value, oldval) => {
|
||||
if (myvalueDate.value) {
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
watch(() => props.value, (value, oldval) => {
|
||||
if (value) {
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(value)
|
||||
// myvalueDate.value = myvalue.value
|
||||
console.log('myvalue Date = ', myvalue.value)
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ export default defineComponent({
|
||||
// console.log('Close')
|
||||
saveit.value = true
|
||||
showDateTimeScroller.value = false
|
||||
emit('savetoclose', myvalue, valueprec)
|
||||
emit('savetoclose', myvalue.value, valueprec.value)
|
||||
}
|
||||
|
||||
function scrollerPopupStyle280() {
|
||||
@@ -128,10 +129,9 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function created() {
|
||||
if (props.value !== null)
|
||||
myvalue.value = props.value
|
||||
else
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
if (props.value !== null) {
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(props.value)
|
||||
}
|
||||
|
||||
// console.log('created myvalue', myvalue)
|
||||
}
|
||||
@@ -139,6 +139,8 @@ export default defineComponent({
|
||||
function changeval(newval: Date) {
|
||||
// console.log('changeval', newval, 'value=', value, 'myvalue=', myvalue)
|
||||
emit('update:value', newval)
|
||||
saveit.value = true
|
||||
emit('savetoclose', myvalue.value, valueprec.value)
|
||||
}
|
||||
|
||||
function mystyle() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="" :style="mystyle">
|
||||
<div class="" :style="mystyle()">
|
||||
<q-input
|
||||
v-model="myvalue"
|
||||
v-show="false"
|
||||
@@ -14,7 +14,7 @@
|
||||
mask="####-##-## ##:##"
|
||||
debounce="500"
|
||||
@input="changeval"
|
||||
:input-class="getclass"
|
||||
:input-class="getclass()"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
color="blue-6"
|
||||
:bg-color="bgcolor"
|
||||
debounce="500"
|
||||
:input-class="getclass">
|
||||
:input-class="getclass()">
|
||||
|
||||
<template v-slot:control>
|
||||
<div style="">
|
||||
<div class="self-center full-width no-outline" :style="mystyle" tabindex="0">
|
||||
<div class="self-center full-width no-outline" :style="mystyle()" tabindex="0">
|
||||
{{ getstrDate(myvalue) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,6 +39,20 @@
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="canEdit" name="event" class="cursor-pointer">
|
||||
<q-popup-proxy v-model="showDateTimeScroller" @before-show="Opening" @before-hide="Closing">
|
||||
|
||||
<div class="q-gutter-md row items-start">
|
||||
<q-date
|
||||
v-model="myvalue" mask="YYYY-MM-DD HH:mm" color="purple"
|
||||
@update:model-value="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
/>
|
||||
<q-time
|
||||
v-model="myvalue" mask="YYYY-MM-DD HH:mm" color="purple"
|
||||
@update:model-value="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<q-input
|
||||
v-model="myvalue"
|
||||
|
||||
@@ -19,7 +19,7 @@ export default defineComponent({
|
||||
required: true,
|
||||
},
|
||||
listimages: {
|
||||
type: Object as PropType<IImgGallery[]>,
|
||||
type: Object as PropType<IImgGallery[] | null>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
@@ -31,14 +31,16 @@ export default defineComponent({
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const mygall = ref(<IGallery>{})
|
||||
const mylistimages = ref(<IImgGallery[]>[])
|
||||
const mylistimages = ref(<IImgGallery[] | null>[])
|
||||
|
||||
watch(() => props.gall, (newval, oldval) => {
|
||||
mygall.value = props.gall
|
||||
})
|
||||
|
||||
watch(() => props.listimages, (newval, oldval) => {
|
||||
if (props.listimages) {
|
||||
mylistimages.value = props.listimages
|
||||
}
|
||||
})
|
||||
|
||||
function created() {
|
||||
@@ -83,6 +85,8 @@ export default defineComponent({
|
||||
return
|
||||
}
|
||||
|
||||
if (mylistimages.value) {
|
||||
|
||||
const draggedId = e.dataTransfer.getData('text')
|
||||
let dragout = ''
|
||||
try {
|
||||
@@ -147,6 +151,7 @@ export default defineComponent({
|
||||
|
||||
save()
|
||||
}
|
||||
}
|
||||
|
||||
function getclass() {
|
||||
return (props.edit) ? 'my-card-gallery' : 'my-card-gallery-view' + ' text-center'
|
||||
@@ -157,6 +162,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getlastord() {
|
||||
if (mylistimages.value) {
|
||||
let myord = 0
|
||||
for (const file of mylistimages.value) {
|
||||
if (file.order! > myord)
|
||||
@@ -165,19 +171,23 @@ export default defineComponent({
|
||||
|
||||
return myord + 10
|
||||
}
|
||||
}
|
||||
|
||||
function uploaded(info: any) {
|
||||
console.log(info)
|
||||
if (mylistimages.value) {
|
||||
for (const file of info.files) {
|
||||
mylistimages.value.push({ imagefile: file.name, order: getlastord() })
|
||||
}
|
||||
|
||||
save()
|
||||
}
|
||||
}
|
||||
|
||||
function deleted(rec: any) {
|
||||
// console.table(mylistimages)
|
||||
|
||||
if (mylistimages.value) {
|
||||
const index = mylistimages.value.findIndex((elem) => elem.imagefile === rec.imagefile)
|
||||
if (index > -1) {
|
||||
mylistimages.value.splice(index, 1)
|
||||
@@ -189,9 +199,10 @@ export default defineComponent({
|
||||
|
||||
save()
|
||||
}
|
||||
}
|
||||
|
||||
function getfullname(rec: any) {
|
||||
return 'statics/upload/' + mygall.value.directory + '/' + rec.imagefile
|
||||
return 'upload/' + mygall.value.directory + '/' + rec.imagefile
|
||||
}
|
||||
|
||||
function copytoclipboard(rec: any) {
|
||||
@@ -217,9 +228,9 @@ export default defineComponent({
|
||||
function getsrcimg(mygallery: any) {
|
||||
|
||||
if (tools.getextfile(mygallery.imagefile) === 'pdf')
|
||||
return 'statics/images/images/pdf.jpg'
|
||||
return 'images/images/pdf.jpg'
|
||||
else
|
||||
return 'statics/upload/' + mygall.value.directory + '/' + mygallery.imagefile
|
||||
return 'upload/' + mygall.value.directory + '/' + mygallery.imagefile
|
||||
}
|
||||
|
||||
created()
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<q-uploader
|
||||
label="Aggiungi Immagine o PDF"
|
||||
accept=".jpg, image/*, .pdf"
|
||||
:url="tools.geturlupload()+`/` + gall.directory"
|
||||
:url="tools.geturlupload()+`/` + gall.directory + '/' + tools.getvers()"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="2000000"
|
||||
multiple
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</div>
|
||||
<div :class="getclassCol(col) + ` q-ma-sm q-pa-sm col-grow rounded-borders`" style="border: 1px solid #bbb">
|
||||
<div v-if="type === costanti.FieldType.date">
|
||||
Date10:
|
||||
<CDateTime
|
||||
:label="col.label"
|
||||
class="cursor-pointer"
|
||||
@@ -32,6 +33,7 @@
|
||||
</CDateTime>
|
||||
</div>
|
||||
<div v-else-if="type === costanti.FieldType.onlydate">
|
||||
Date11:
|
||||
<CDateTime
|
||||
:label="col.label"
|
||||
class="cursor-pointer"
|
||||
|
||||
@@ -199,6 +199,7 @@ export default defineComponent({
|
||||
newVal = true
|
||||
myvalueprec.value = myvalue.value
|
||||
myvalue.value = newVal
|
||||
|
||||
}
|
||||
// console.log('DOPO myvalue', myvalue, newVal, myvalueprec)
|
||||
}
|
||||
@@ -289,7 +290,8 @@ export default defineComponent({
|
||||
return ''
|
||||
}
|
||||
}
|
||||
function selectcountry({ name, iso2, dialCode }: { name: string, iso2: string, dialCode: string}) {
|
||||
|
||||
function selectcountry({ name, iso2, dialCode }: {name: string, iso2: string, dialCode: string}) {
|
||||
// console.log(name, iso2, dialCode)
|
||||
myvalueprec.value = myvalue.value
|
||||
myvalue.value = iso2
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<CDateTime
|
||||
:label="col.label"
|
||||
class="cursor-pointer"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="true"
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.listimages">
|
||||
<CGallery
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield"
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield()"
|
||||
@showandsave="Savedb"
|
||||
@input="changevalRec"
|
||||
>
|
||||
@@ -93,7 +93,7 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
||||
<CGallery
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield"
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield()"
|
||||
@input="changevalRec"
|
||||
@showandsave="Savedb">
|
||||
|
||||
@@ -147,14 +147,14 @@
|
||||
<div v-else>
|
||||
<div v-if="col.fieldtype === costanti.FieldType.listimages">
|
||||
<CGallery
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield"
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield()"
|
||||
@showandsave="Savedb">
|
||||
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
||||
<CGallery
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield"
|
||||
:gall="row" :listimages="myvalue" :edit="isviewfield()"
|
||||
@showandsave="Savedb">
|
||||
|
||||
</CGallery>
|
||||
@@ -173,9 +173,10 @@
|
||||
<!-- Edit Value -->
|
||||
<span v-if="col.fieldtype === costanti.FieldType.date">
|
||||
<CDateTime
|
||||
v-if="myvalue"
|
||||
:label="col.label"
|
||||
class="cursor-pointer"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="true"
|
||||
@@ -185,10 +186,12 @@
|
||||
</CDateTime>
|
||||
</span>
|
||||
<span v-else-if="col.fieldtype === costanti.FieldType.onlydate">
|
||||
Data4:
|
||||
<CDateTime
|
||||
:label="col.label"
|
||||
class="cursor-pointer"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:readonly="false"
|
||||
:minuteinterval="minuteinterval"
|
||||
:dense="true"
|
||||
|
||||
@@ -15,7 +15,7 @@ const functionality: IFunctionality = {
|
||||
SHOW_NEWSLETTER: false,
|
||||
SHOW_ONLY_POLICY: false,
|
||||
ENABLE_TODOS_LOADING: true,
|
||||
ENABLE_PROJECTS_LOADING: true,
|
||||
ENABLE_PROJECTS_LOADING: false,
|
||||
SHOW_IF_IS_SERVER_CONNECTION: false,
|
||||
SHOW_MESSAGES: false,
|
||||
BOOKING_EVENTS: false,
|
||||
@@ -319,7 +319,9 @@ const baseroutes: IListRoutes[] = [
|
||||
},
|
||||
|
||||
*/
|
||||
{
|
||||
|
||||
/*
|
||||
<{
|
||||
active: true,
|
||||
order: 7,
|
||||
path: '/c',
|
||||
@@ -333,6 +335,7 @@ const baseroutes: IListRoutes[] = [
|
||||
solotitle: true,
|
||||
infooter: true,
|
||||
},
|
||||
*/
|
||||
{
|
||||
active: true,
|
||||
order: 2000,
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
:header-inset-level="child2.level_child"
|
||||
:duration="300"
|
||||
:icon="child2.materialIcon"
|
||||
expand-icon="none"
|
||||
active-class="my-menu-active"
|
||||
expand-icon-class="my-menu-icon-none"
|
||||
:class="`item item-link drawer-closer cursor-pointer ` + clBase"
|
||||
:label="tools.getLabelByItem(child2)">
|
||||
|
||||
<template v-slot:header>
|
||||
<q-item-section avatar>
|
||||
|
||||
<q-avatar v-if="child2.img">
|
||||
<div :icon="`img:`+child2.img" class="imgicon" font-size="2rem"></div>
|
||||
<div :icon="`img:`+child2.img" class="imgicon" style="font-size:2rem;"></div>
|
||||
</q-avatar>
|
||||
<div v-else>
|
||||
<q-avatar
|
||||
@@ -55,23 +55,6 @@
|
||||
{{ tools.getLabelByItem(child2) }}
|
||||
</q-item-section>
|
||||
|
||||
</template>
|
||||
|
||||
<div v-for="(child3, index) in child2.routes2" :key="index">
|
||||
<q-expansion-item
|
||||
v-if="!!child2.routes2 && child3.active"
|
||||
:to="getroute(child3)"
|
||||
:header-inset-level="child3.level_child"
|
||||
:duration="300"
|
||||
:icon="child3.materialIcon"
|
||||
:expand-icon="child3.icon"
|
||||
expand-icon-class="my-menu-separat"
|
||||
active-class="my-menu-active"
|
||||
:class="`item item-link drawer-closer cursor-pointer ` + clBase"
|
||||
:label="tools.getLabelByItem(child3)">
|
||||
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
</q-expansion-item>
|
||||
<q-expansion-item
|
||||
v-else
|
||||
@@ -82,6 +65,7 @@
|
||||
expand-icon-class="my-menu-separat"
|
||||
:header-class="getmymenuclass(child2)"
|
||||
active-class="my-menu-active">
|
||||
AA5:
|
||||
<div v-for="(child3, index) in child2.routes2" :key="index">
|
||||
<div v-if="child3.active">
|
||||
<q-expansion-item
|
||||
@@ -139,6 +123,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,5 +137,5 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './menuOne.scss';
|
||||
@import './menuOne.scss';
|
||||
</style>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<q-uploader
|
||||
label="Galleria Home"
|
||||
accept=".jpg, image/*"
|
||||
:url="tools.geturlupload()+`/gallery_home`"
|
||||
:url="tools.geturlupload()+`/gallery_home/${tools.getvers()}`"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="2000000"
|
||||
multiple
|
||||
@@ -14,7 +14,7 @@
|
||||
<q-uploader
|
||||
label="Immagini"
|
||||
accept=".jpg, image/*"
|
||||
:url="tools.geturlupload()+`/img`"
|
||||
:url="tools.geturlupload()+`/img/${tools.getvers()}`"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="1000000"
|
||||
multiple
|
||||
@@ -24,7 +24,7 @@
|
||||
<q-uploader
|
||||
label="Invia PDF"
|
||||
accept=".pdf"
|
||||
:url="tools.geturlupload()+`/pdf`"
|
||||
:url="tools.geturlupload()+`/pdf/${tools.getvers()}`"
|
||||
:headers="tools.getheaders()"
|
||||
multiple
|
||||
style="max-width: 300px"
|
||||
|
||||
@@ -2404,6 +2404,11 @@ export const tools = {
|
||||
return date.formatDate(mytimestamp, 'YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
|
||||
getstrdateToDate(strdate: string) {
|
||||
let mydate = new Date(strdate)
|
||||
return mydate
|
||||
},
|
||||
|
||||
gettimestampstrDate(mydatestr: Date | number | string | undefined) {
|
||||
if (mydatestr) {
|
||||
const mydate = new Date(mydatestr)
|
||||
@@ -3357,6 +3362,9 @@ export const tools = {
|
||||
geturlupload() {
|
||||
return process.env.MONGODB_HOST + '/upload'
|
||||
},
|
||||
getvers() {
|
||||
return process.env.APP_VERSION
|
||||
},
|
||||
getheaders() {
|
||||
const userStore = useUserStore()
|
||||
return [{ name: 'x-auth', value: userStore.x_auth_token }]
|
||||
|
||||
BIN
statics/upload/gallery/cupole_geodetiche.jpg
Normal file
BIN
statics/upload/gallery/cupole_geodetiche.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 381 KiB |
BIN
statics/upload/gallery/fuoco.jpg
Normal file
BIN
statics/upload/gallery/fuoco.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
BIN
upload/gallery/vendemmia.jpeg
Normal file
BIN
upload/gallery/vendemmia.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Reference in New Issue
Block a user