- CGallery MyFieldDB
@@ -4,7 +4,7 @@ function geturl() {
|
|||||||
if (miaurl.includes('localhost')) {
|
if (miaurl.includes('localhost')) {
|
||||||
return 'http://localhost:8084/'
|
return 'http://localhost:8084/'
|
||||||
}
|
}
|
||||||
return 'https://mandalasolidale.freeplanet.app/'
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function getidtrack() {
|
function getidtrack() {
|
||||||
|
|||||||
BIN
public/upload/gallery/spaccata.jpg
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
public/upload/none/bozza.jpg
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
public/upload/none/citta.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
public/upload/none/matrimonio.jpeg
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
public/upload/none/posizioni.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/upload/none/serenita_interiore.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
public/upload/none/temperare.png
Normal file
|
After Width: | Height: | Size: 255 KiB |
BIN
public/upload/profile/paoloar77/alzata.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
public/upload/profile/paoloar77/ball4.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
public/upload/profile/paoloar77/beachpao.jpg
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
public/upload/profile/paoloar77/myskills/alzata.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
public/upload/profile/paoloar77/myskills/ball4.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
public/upload/profile/paoloar77/myskills/beach1.jpg
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
public/upload/undefined/serenita_interiore.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
public/upload/users/ball4.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
@@ -14,6 +14,11 @@ export default defineComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
single: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
title: String,
|
title: String,
|
||||||
directory: {
|
directory: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -72,14 +77,14 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getnumimages() {
|
function getnumimages() {
|
||||||
if (gallerylist.value && gallerylist.value)
|
if (gallerylist.value)
|
||||||
return gallerylist.value.length
|
return gallerylist.value.length
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function getlistimages() {
|
function getlistimages() {
|
||||||
if (gallerylist.value && gallerylist.value)
|
if (gallerylist.value)
|
||||||
return gallerylist.value.slice().sort((a: any, b: any) => a.order! - b.order!)
|
return gallerylist.value.slice().sort((a: any, b: any) => a.order! - b.order!)
|
||||||
else
|
else
|
||||||
return null
|
return null
|
||||||
@@ -179,6 +184,7 @@ export default defineComponent({
|
|||||||
// e.target.appendChild(draggedEl)
|
// e.target.appendChild(draggedEl)
|
||||||
e.target.classList.remove('drag-enter')
|
e.target.classList.remove('drag-enter')
|
||||||
|
|
||||||
|
|
||||||
save()
|
save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,6 +216,7 @@ export default defineComponent({
|
|||||||
gallerylist.value.push({ imagefile: file.name, order: getlastord() })
|
gallerylist.value.push({ imagefile: file.name, order: getlastord() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!props.single)
|
||||||
save()
|
save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,6 +226,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deleted(rec: any) {
|
function deleted(rec: any) {
|
||||||
|
console.log('deleted', rec.imagefile)
|
||||||
// console.table(mylistimages)
|
// console.table(mylistimages)
|
||||||
|
|
||||||
if (gallerylist.value) {
|
if (gallerylist.value) {
|
||||||
@@ -231,9 +239,13 @@ export default defineComponent({
|
|||||||
|
|
||||||
// console.table(mylistimages)
|
// console.table(mylistimages)
|
||||||
|
|
||||||
|
console.log('single', props.single)
|
||||||
|
|
||||||
|
if (!props.single) {
|
||||||
save()
|
save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getfullname(rec: any) {
|
function getfullname(rec: any) {
|
||||||
return 'upload/' + props.directory + '/' + rec.imagefile
|
return 'upload/' + props.directory + '/' + rec.imagefile
|
||||||
@@ -246,25 +258,41 @@ export default defineComponent({
|
|||||||
|
|
||||||
async function deleteFile(rec: any)
|
async function deleteFile(rec: any)
|
||||||
{
|
{
|
||||||
|
console.log('deleteFile....')
|
||||||
const filename = getfullname(rec)
|
const filename = getfullname(rec)
|
||||||
|
|
||||||
// Delete File on server:
|
// Delete File on server:
|
||||||
const ris = await globalStore.DeleteFile({ filename })
|
const ris = await globalStore.DeleteFile({ filename })
|
||||||
|
console.log('ris', ris)
|
||||||
if (ris)
|
if (ris)
|
||||||
deleted(rec)
|
deleted(rec)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
|
if (gallerylist.value.length > 0) {
|
||||||
|
if (!props.single) {
|
||||||
emit('showandsave', gallerylist.value)
|
emit('showandsave', gallerylist.value)
|
||||||
|
} else {
|
||||||
|
emit('showandsave', gallerylist.value[0].imagefile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
save()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getsrcimg(gallerylistery: any) {
|
function getsrcimg(gallerylistery: any) {
|
||||||
|
|
||||||
|
if (gallerylistery) {
|
||||||
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
||||||
return 'images/images/pdf.jpg'
|
return 'images/images/pdf.jpg'
|
||||||
else
|
else
|
||||||
return 'upload/' + props.directory + '/' + gallerylistery.imagefile
|
return 'upload/' + props.directory + '/' + gallerylistery.imagefile
|
||||||
|
} else {
|
||||||
|
return 'images/noimg.png';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParamDir() {
|
function getParamDir() {
|
||||||
@@ -273,7 +301,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
function getUrl() {
|
function getUrl() {
|
||||||
const myurl = tools.geturlupload() + getParamDir()
|
const myurl = tools.geturlupload() + getParamDir()
|
||||||
console.log('myurl', myurl)
|
// console.log('myurl', myurl)
|
||||||
return myurl
|
return myurl
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,6 +329,7 @@ export default defineComponent({
|
|||||||
save,
|
save,
|
||||||
maximizedToggle,
|
maximizedToggle,
|
||||||
getUrl,
|
getUrl,
|
||||||
|
close,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<div class=" row">
|
<div class=" row">
|
||||||
<!--<q-draggable-rows
|
<!--<q-draggable-rows
|
||||||
v-model="order">-->
|
v-model="order">-->
|
||||||
|
|
||||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||||
<div
|
<div
|
||||||
class="q-pa-sm q-gutter-sm"
|
class="q-pa-sm q-gutter-sm"
|
||||||
@@ -115,7 +116,7 @@
|
|||||||
<q-btn dense flat icon="crop_square" @click="maximizedToggle = true" :disable="maximizedToggle">
|
<q-btn dense flat icon="crop_square" @click="maximizedToggle = true" :disable="maximizedToggle">
|
||||||
<q-tooltip v-if="!maximizedToggle" class="bg-white text-primary">Maximize</q-tooltip>
|
<q-tooltip v-if="!maximizedToggle" class="bg-white text-primary">Maximize</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn dense flat icon="close" v-close-popup>
|
<q-btn dense flat icon="close" v-close-popup @click="close">
|
||||||
<q-tooltip class="bg-white text-primary">Close</q-tooltip>
|
<q-tooltip class="bg-white text-primary">Close</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-bar>
|
</q-bar>
|
||||||
@@ -126,6 +127,7 @@
|
|||||||
|
|
||||||
<q-card-section class="q-pt-none">
|
<q-card-section class="q-pt-none">
|
||||||
<div class=" row">
|
<div class=" row">
|
||||||
|
|
||||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||||
<div
|
<div
|
||||||
class="q-pa-sm q-gutter-sm"
|
class="q-pa-sm q-gutter-sm"
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
:table="prop_mytable"
|
:table="prop_mytable"
|
||||||
:canEdit="canEdit"
|
:canEdit="canEdit"
|
||||||
:disable="disabilita()"
|
:disable="disabilita()"
|
||||||
:col="col"
|
:mycol="col"
|
||||||
v-model:row="props.row"
|
v-model:row="props.row"
|
||||||
:field="col.field"
|
:field="col.field"
|
||||||
:subfield="col.subfield"
|
:subfield="col.subfield"
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
:canEdit="true"
|
:canEdit="true"
|
||||||
:disable="disabilita()"
|
:disable="disabilita()"
|
||||||
view="field"
|
view="field"
|
||||||
:col="mycol"
|
:mycol="mycol"
|
||||||
:showall="true"
|
:showall="true"
|
||||||
:row="rowclicksel"
|
:row="rowclicksel"
|
||||||
:field="mycol.field"
|
:field="mycol.field"
|
||||||
@@ -239,7 +239,7 @@
|
|||||||
<CMyPopupEdit
|
<CMyPopupEdit
|
||||||
:table="prop_mytable"
|
:table="prop_mytable"
|
||||||
:canEdit="true"
|
:canEdit="true"
|
||||||
:col="col"
|
:mycol="col"
|
||||||
v-model:row="newRecord"
|
v-model:row="newRecord"
|
||||||
:field="col.field"
|
:field="col.field"
|
||||||
:subfield="col.subfield"
|
:subfield="col.subfield"
|
||||||
|
|||||||
@@ -1,21 +1,12 @@
|
|||||||
import { defineComponent, PropType, ref, watch } from 'vue'
|
import { defineComponent, PropType, ref, watch } from 'vue'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { useI18n } from '@/boot/i18n'
|
import { useI18n } from '@/boot/i18n'
|
||||||
import { useUserStore } from '@store/UserStore'
|
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
import { IColGridTable } from 'model'
|
|
||||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||||
import { tools } from '@store/Modules/tools'
|
import { tools } from '@store/Modules/tools'
|
||||||
import { toolsext } from '@store/Modules/toolsext'
|
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
import MixinBase from '../../mixins/mixin-base'
|
import { CMyPopupEdit } from '@/components/CMyPopupEdit'
|
||||||
import MixinUsers from '../../mixins/mixin-users'
|
import { IColGridTable } from 'model'
|
||||||
import { CMyEditor } from '@/components/CMyEditor'
|
|
||||||
import { CMySelect } from '@/components/CMySelect'
|
|
||||||
import { CMyChipList } from '@/components/CMyChipList'
|
|
||||||
import { CMyToggleList } from '@/components/CMyToggleList'
|
|
||||||
import { CDateTime } from '@/components/CDateTime'
|
|
||||||
import { CGallery } from '@/components/CGallery'
|
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@@ -84,184 +75,22 @@ export default defineComponent({
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: { CMyEditor, CMySelect, CMyChipList, CMyToggleList, CDateTime, CGallery },
|
components: { CMyPopupEdit },
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
const myvalue = ref('')
|
const col = ref(<IColGridTable> { name: 'test' })
|
||||||
|
const row = ref({})
|
||||||
const col: IColGridTable = { name: 'test' }
|
|
||||||
|
|
||||||
const canEdit = ref(true)
|
|
||||||
|
|
||||||
const countryname = ref('')
|
|
||||||
|
|
||||||
const { setValDb, getValDb } = MixinBase()
|
|
||||||
const { getMyUsername } = MixinUsers()
|
|
||||||
|
|
||||||
function crea() {
|
|
||||||
|
|
||||||
myvalue.value = getValDb(props.mykey, props.serv, '', props.table, props.mysubkey, props.id, props.idmain)
|
|
||||||
col.jointable = props.jointable
|
|
||||||
col.fieldtype = props.type
|
|
||||||
col.label = props.title
|
|
||||||
|
|
||||||
// console.log('CMyFieldDb crea', myvalue)
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(() => props.id, (newval, oldval) => {
|
|
||||||
crea()
|
|
||||||
})
|
|
||||||
|
|
||||||
function getclassCol(col: any) {
|
|
||||||
if (col) {
|
|
||||||
let mycl = (props.disable || col.disable) ? '' : 'colmodif '
|
|
||||||
mycl += ((col.fieldtype === costanti.FieldType.date) || (col.fieldtype === costanti.FieldType.onlydate)) ? ' coldate flex flex-container ' : ''
|
|
||||||
|
|
||||||
return mycl
|
|
||||||
} else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function visuValByType(val: any) {
|
|
||||||
if (col.fieldtype === costanti.FieldType.date) {
|
|
||||||
if (val === undefined) {
|
|
||||||
return '[]'
|
|
||||||
} else {
|
|
||||||
return tools.getstrDateTime(val)
|
|
||||||
}
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.onlydate) {
|
|
||||||
if (val === undefined) {
|
|
||||||
return '[]'
|
|
||||||
} else {
|
|
||||||
return tools.getstrDate(val)
|
|
||||||
}
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.boolean) {
|
|
||||||
return (val) ? t('dialog.yes') : t('dialog.no')
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.binary) {
|
|
||||||
if (val === undefined)
|
|
||||||
return '[---]'
|
|
||||||
else
|
|
||||||
return globalStore.getArrStrByValueBinary(col, val)
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.select) {
|
|
||||||
if (val === undefined)
|
|
||||||
return '[---]'
|
|
||||||
else
|
|
||||||
return globalStore.getValueByTable(col, val)
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.multiselect) {
|
|
||||||
if (val === undefined)
|
|
||||||
return '[---]'
|
|
||||||
else
|
|
||||||
return globalStore.getMultiValueByTable(col, val)
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.multioption) {
|
|
||||||
if (val === undefined)
|
|
||||||
return '[---]'
|
|
||||||
else
|
|
||||||
return globalStore.getMultiValueByTable(col, val)
|
|
||||||
} else if (col.fieldtype === costanti.FieldType.password) {
|
|
||||||
if (val === undefined)
|
|
||||||
return '[---]'
|
|
||||||
else
|
|
||||||
return '***************'
|
|
||||||
} else {
|
|
||||||
if (val === undefined)
|
|
||||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
|
||||||
else if (val === '') {
|
|
||||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
|
||||||
} else {
|
|
||||||
let mystr = tools.firstchars(val, 5000)
|
|
||||||
if (val) {
|
|
||||||
if (val.length > 5000)
|
|
||||||
mystr += '...'
|
|
||||||
} else {
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
return mystr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function mycl() {
|
|
||||||
if (props.disable) {
|
|
||||||
return 'cldisable'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function myvalprinted() {
|
|
||||||
return visuValByType(myvalue.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function savefield(value: any, initialval: any, myq: any) {
|
|
||||||
myvalue.value = value
|
|
||||||
setValDb(myq, props.mykey, myvalue.value, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey)
|
|
||||||
}
|
|
||||||
|
|
||||||
function savefieldboolean(value: any) {
|
|
||||||
if (myvalue.value === undefined)
|
|
||||||
myvalue.value = 'true'
|
|
||||||
else
|
|
||||||
myvalue.value = value
|
|
||||||
|
|
||||||
setValDb($q, props.mykey, myvalue, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectcountry({ name, iso2, dialCode }: { name: string, iso2: string, dialCode: string }) {
|
|
||||||
// console.log(name, iso2, dialCode)
|
|
||||||
myvalue.value = iso2
|
|
||||||
countryname.value = name
|
|
||||||
}
|
|
||||||
|
|
||||||
function intcode_change(coderec: any) {
|
|
||||||
myvalue.value = '+' + coderec.dialCode
|
|
||||||
}
|
|
||||||
|
|
||||||
function onInput(phone: any, phoneObject: any, input: any) {
|
|
||||||
if (phoneObject?.formatted) {
|
|
||||||
myvalue.value = phoneObject.formatted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploaded(info: any) {
|
|
||||||
|
|
||||||
if (info.files) {
|
|
||||||
myvalue.value = tools.geturlrelativeprofile()+ '/' + getMyUsername() + '/' + info.files[0].name
|
|
||||||
console.log('uploaded', myvalue.value)
|
|
||||||
savefield(myvalue.value, '', $q)
|
|
||||||
}
|
|
||||||
// info.files[0].name
|
|
||||||
}
|
|
||||||
|
|
||||||
function removephoto() {
|
|
||||||
myvalue.value = ''
|
|
||||||
savefield(myvalue.value, '', $q)
|
|
||||||
}
|
|
||||||
|
|
||||||
crea()
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mycl,
|
|
||||||
intcode_change,
|
|
||||||
selectcountry,
|
|
||||||
savefieldboolean,
|
|
||||||
savefield,
|
|
||||||
myvalprinted,
|
|
||||||
getclassCol,
|
|
||||||
canEdit,
|
|
||||||
myvalue,
|
|
||||||
col,
|
|
||||||
countryname,
|
|
||||||
onInput,
|
|
||||||
tools,
|
tools,
|
||||||
costanti,
|
costanti,
|
||||||
myq: $q,
|
|
||||||
fieldsTable,
|
fieldsTable,
|
||||||
globalStore,
|
globalStore,
|
||||||
uploaded,
|
col,
|
||||||
getMyUsername,
|
row,
|
||||||
removephoto,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,6 +19,38 @@
|
|||||||
</template>
|
</template>
|
||||||
</q-field>
|
</q-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div :class="` q-ma-sm q-pa-sm col-grow rounded-borders `" style="border: 1px solid #bbb">
|
||||||
|
<CMyPopupEdit
|
||||||
|
:title="title"
|
||||||
|
:field="mykey"
|
||||||
|
:subfield="mysubkey"
|
||||||
|
:mysubsubkey="mysubsubkey"
|
||||||
|
:indrec="indrec"
|
||||||
|
:type="type"
|
||||||
|
:serv="serv"
|
||||||
|
:disable="disable"
|
||||||
|
:jointable="jointable"
|
||||||
|
:table="table"
|
||||||
|
:myimg="myimg"
|
||||||
|
:id="id"
|
||||||
|
:idmain="idmain"
|
||||||
|
:canEdit="true"
|
||||||
|
:mycol="col"
|
||||||
|
v-model:row="row"
|
||||||
|
minuteinterval="1"
|
||||||
|
>
|
||||||
|
|
||||||
|
</CMyPopupEdit>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
@save="SaveValue"
|
||||||
|
@show="selItem(props.row, col)"
|
||||||
|
@showandsave="showandsel"
|
||||||
|
|
||||||
|
|
||||||
<div :class="getclassCol(col) + ` q-ma-sm q-pa-sm col-grow rounded-borders `" style="border: 1px solid #bbb">
|
<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">
|
<div v-if="type === costanti.FieldType.date">
|
||||||
<CDateTime
|
<CDateTime
|
||||||
@@ -53,7 +85,6 @@
|
|||||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||||
</div>
|
</div>
|
||||||
<!-- Show Value -->
|
|
||||||
<div v-else-if="type === costanti.FieldType.nationality">
|
<div v-else-if="type === costanti.FieldType.nationality">
|
||||||
<q-input
|
<q-input
|
||||||
input-class="cursor-pointer text-center"
|
input-class="cursor-pointer text-center"
|
||||||
@@ -65,14 +96,6 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<div class="hidden">
|
<div class="hidden">
|
||||||
<!--<vue-country-code
|
|
||||||
:defaultCountry="myvalue"
|
|
||||||
:disabledFetchingCountry="true"
|
|
||||||
@onSelect="selectcountry"
|
|
||||||
:preferredCountries="tools.getprefCountries"
|
|
||||||
:dropdownOptions="{ disabledDialCode: true }">
|
|
||||||
|
|
||||||
</vue-country-code>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
@@ -222,14 +245,6 @@
|
|||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<div style="font-size: 1rem;">
|
<div style="font-size: 1rem;">
|
||||||
<!--<vue-country-code
|
|
||||||
:defaultCountry="myvalue"
|
|
||||||
:disabledFetchingCountry="true"
|
|
||||||
@onSelect="selectcountry"
|
|
||||||
:preferredCountries="tools.getprefCountries"
|
|
||||||
:dropdownOptions="{ disabledDialCode: true }">
|
|
||||||
|
|
||||||
</vue-country-code>-->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
@@ -241,17 +256,6 @@
|
|||||||
<div v-else-if="col.fieldtype === costanti.FieldType.intcode">
|
<div v-else-if="col.fieldtype === costanti.FieldType.intcode">
|
||||||
|
|
||||||
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
|
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
|
||||||
<!--<vue-tel-input
|
|
||||||
@country-changed="intcode_change"
|
|
||||||
:value="myvalue"
|
|
||||||
@update:model-value="onInput"
|
|
||||||
:disabledFetchingCountry="true"
|
|
||||||
:preferredCountries="tools.getprefCountries"
|
|
||||||
:placeholder="$t('reg.cell')"
|
|
||||||
:enabledCountryCode="true"
|
|
||||||
inputClasses="clCell"
|
|
||||||
wrapperClasses="clCellCode">
|
|
||||||
</vue-tel-input>-->
|
|
||||||
<div style="height: 180px;">
|
<div style="height: 180px;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -268,25 +272,6 @@
|
|||||||
:isarray="true">
|
:isarray="true">
|
||||||
</CMyToggleList>
|
</CMyToggleList>
|
||||||
|
|
||||||
<!--
|
|
||||||
<q-select
|
|
||||||
v-model="scope.value"
|
|
||||||
rounded
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
multiple
|
|
||||||
options-dense
|
|
||||||
:display-value="fieldsTable.getTitleByTable(col.jointable)"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="globalStore.getTableJoinByName(col.jointable)"
|
|
||||||
:option-label="fieldsTable.getLabelByTable(col.jointable)"
|
|
||||||
:option-value="fieldsTable.getKeyByTable(col.jointable)"
|
|
||||||
style="min-width: 150px"
|
|
||||||
>
|
|
||||||
|
|
||||||
</q-select>
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.multioption">
|
<div v-else-if="col.fieldtype === costanti.FieldType.multioption">
|
||||||
</div>
|
</div>
|
||||||
@@ -316,7 +301,8 @@
|
|||||||
color="blue" icon="fas fa-trash-alt" size="sm"
|
color="blue" icon="fas fa-trash-alt" size="sm"
|
||||||
@click="removephoto"></q-btn>
|
@click="removephoto"></q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { defineComponent, onMounted, ref, toRef } from 'vue'
|
import { defineComponent, onMounted, PropType, ref, toRef, watch } from 'vue'
|
||||||
import { useI18n } from '@src/boot/i18n'
|
import { useI18n } from '@src/boot/i18n'
|
||||||
import { useUserStore } from '@store/UserStore'
|
import { useUserStore } from '@store/UserStore'
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { IColGridTable } from 'model'
|
import { IColGridTable, IImgGallery } from 'model'
|
||||||
import { CMyChipList } from '../CMyChipList'
|
import { CMyChipList } from '../CMyChipList'
|
||||||
import { CDate } from '../CDate'
|
import { CDate } from '../CDate'
|
||||||
import { CDateTime } from '../CDateTime'
|
import { CDateTime } from '../CDateTime'
|
||||||
@@ -15,16 +15,23 @@ import { tools } from '@store/Modules/tools'
|
|||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
|
|
||||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||||
|
import MixinBase from '@/mixins/mixin-base'
|
||||||
|
import MixinUsers from '@/mixins/mixin-users'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'CMyPopupEdit',
|
name: 'CMyPopupEdit',
|
||||||
props: {
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
row: {
|
row: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
col: {
|
mycol: {
|
||||||
type: Object,
|
type: Object as PropType<IColGridTable>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
canEdit: {
|
canEdit: {
|
||||||
@@ -42,6 +49,26 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
mysubsubkey: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
serv: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
indrec: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: -1,
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
showall: {
|
showall: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -67,11 +94,31 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
jointable: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
table: {
|
table: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
myimg: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
idmain: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: { CMyChipList, CDateTime, CDate, CMyToggleList, CMySelect, CMyEditor, CGallery },
|
components: { CMyChipList, CDateTime, CDate, CMyToggleList, CMySelect, CMyEditor, CGallery },
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
@@ -86,8 +133,59 @@ export default defineComponent({
|
|||||||
const visueditor = ref(false)
|
const visueditor = ref(false)
|
||||||
const showeditor = ref(false)
|
const showeditor = ref(false)
|
||||||
|
|
||||||
|
const myImgGall = ref(<IImgGallery[]>[{}])
|
||||||
|
|
||||||
|
const col = ref(<IColGridTable> { name: 'test', fieldtype: 0 })
|
||||||
|
|
||||||
const myrow = toRef(props, 'row')
|
const myrow = toRef(props, 'row')
|
||||||
|
|
||||||
|
const { setValDb, getValDb } = MixinBase()
|
||||||
|
const { getMyUsername } = MixinUsers()
|
||||||
|
|
||||||
|
function crea() {
|
||||||
|
|
||||||
|
if (isFieldDb()) {
|
||||||
|
// mykey -> field
|
||||||
|
// mysubkey -> subfield
|
||||||
|
// table -> table
|
||||||
|
// serv -> serv
|
||||||
|
// id -> id
|
||||||
|
// idmain -> idmain
|
||||||
|
|
||||||
|
// console.table(props)
|
||||||
|
|
||||||
|
myvalue.value = getValDb(props.field, props.serv, '', props.table, props.subfield, props.id, props.idmain)
|
||||||
|
// console.log('myvalue.value', myvalue.value)
|
||||||
|
col.value.jointable = props.jointable
|
||||||
|
col.value.fieldtype = props.type
|
||||||
|
col.value.label = props.title
|
||||||
|
|
||||||
|
if (props.type === costanti.FieldType.image) {
|
||||||
|
myImgGall.value = [{
|
||||||
|
_id: '',
|
||||||
|
imagefile: myvalue.value,
|
||||||
|
order: 1,
|
||||||
|
alt: 'img',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('col', col.value);
|
||||||
|
} else {
|
||||||
|
col.value = {...props.mycol}
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('CMyFieldDb crea', myvalue)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(() => props.id, (newval, oldval) => {
|
||||||
|
crea()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function isFieldDb(){
|
||||||
|
return props.type !== 0
|
||||||
|
}
|
||||||
|
|
||||||
function isviewfield() {
|
function isviewfield() {
|
||||||
return props.view === 'field'
|
return props.view === 'field'
|
||||||
}
|
}
|
||||||
@@ -98,21 +196,21 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getrealval(newval: any) {
|
function getrealval(newval: any) {
|
||||||
if (props.col.fieldtype === costanti.FieldType.hours) {
|
if (col.value.fieldtype === costanti.FieldType.hours) {
|
||||||
newval = newval.value
|
newval = newval.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changevalRec(newval: any) {
|
function changevalRec(newval: any) {
|
||||||
// console.log('row', props.row, 'col', props.col, 'newval', newval)
|
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
|
||||||
// console.log('row[col.name]', props.row[props.col.name])
|
// console.log('row[col.value.name]', props.row[col.value.name])
|
||||||
myrow.value[props.col.name] = newval
|
myrow.value[col.value.name] = newval
|
||||||
// console.log('changevalRec update:row', newval)
|
// console.log('changevalRec update:row', newval)
|
||||||
emit('update:row', props.row)
|
emit('update:row', props.row)
|
||||||
}
|
}
|
||||||
|
|
||||||
function changevalRecHours(newval: any) {
|
function changevalRecHours(newval: any) {
|
||||||
if (props.col.fieldtype === costanti.FieldType.hours) {
|
if (col.value.fieldtype === costanti.FieldType.hours) {
|
||||||
newval = newval.value
|
newval = newval.value
|
||||||
}
|
}
|
||||||
changevalRec(newval)
|
changevalRec(newval)
|
||||||
@@ -126,6 +224,9 @@ export default defineComponent({
|
|||||||
|
|
||||||
function mounted() {
|
function mounted() {
|
||||||
// console.log('mounted')
|
// console.log('mounted')
|
||||||
|
if (isFieldDb()) {
|
||||||
|
|
||||||
|
} else {
|
||||||
if (props.subfield !== '') {
|
if (props.subfield !== '') {
|
||||||
if (props.row[props.field] === undefined) {
|
if (props.row[props.field] === undefined) {
|
||||||
myrow.value[props.field] = {}
|
myrow.value[props.field] = {}
|
||||||
@@ -141,8 +242,9 @@ export default defineComponent({
|
|||||||
myvalue.value = myrow.value
|
myvalue.value = myrow.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (props.col.fieldtype === costanti.FieldType.listimages) {
|
if (col.value.fieldtype === costanti.FieldType.listimages) {
|
||||||
if (myvalue.value === '' || myvalue.value === undefined) {
|
if (myvalue.value === '' || myvalue.value === undefined) {
|
||||||
console.log('set default myvalue.value ')
|
console.log('set default myvalue.value ')
|
||||||
myvalue.value = {
|
myvalue.value = {
|
||||||
@@ -159,7 +261,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('myvalue.value', myvalue.value)
|
// console.log('myvalue.value', myvalue.value)
|
||||||
myvalueprec.value = myvalue.value
|
myvalueprec.value = myvalue.value
|
||||||
|
|
||||||
@@ -171,7 +272,7 @@ export default defineComponent({
|
|||||||
emit('show')
|
emit('show')
|
||||||
}
|
}
|
||||||
|
|
||||||
function getval() {
|
/*function getval() {
|
||||||
let myval: any = 'false'
|
let myval: any = 'false'
|
||||||
|
|
||||||
if ((props.subfield !== '') && (props.subfield !== '')) {
|
if ((props.subfield !== '') && (props.subfield !== '')) {
|
||||||
@@ -189,12 +290,15 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return myval
|
return myval
|
||||||
}
|
}*/
|
||||||
|
|
||||||
function SaveValueInt(newVal: any, valinitial: any) {
|
function SaveValueInt(newVal: any, valinitial: any) {
|
||||||
|
|
||||||
// console.log('SaveValueInt', newVal, valinitial)
|
// console.log('SaveValueInt', newVal, valinitial)
|
||||||
|
|
||||||
|
if (isFieldDb()) {
|
||||||
|
savefield(newVal, valinitial, $q);
|
||||||
|
} else {
|
||||||
// Update value in table memory
|
// Update value in table memory
|
||||||
if (props.subfield !== '') {
|
if (props.subfield !== '') {
|
||||||
if (myrow.value[props.field] === undefined)
|
if (myrow.value[props.field] === undefined)
|
||||||
@@ -209,14 +313,31 @@ export default defineComponent({
|
|||||||
|
|
||||||
emit('save', newVal, valinitial)
|
emit('save', newVal, valinitial)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function savefield(value: any, initialval: any, myq: any) {
|
||||||
|
myvalue.value = value
|
||||||
|
setValDb(myq, props.field, myvalue.value, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function annulla(val: any) {
|
function annulla(val: any) {
|
||||||
emit('annulla', true)
|
emit('annulla', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function savefieldboolean(value: any) {
|
||||||
|
if (myvalue.value === undefined)
|
||||||
|
myvalue.value = 'true'
|
||||||
|
else
|
||||||
|
myvalue.value = value
|
||||||
|
|
||||||
|
setValDb($q, props.field, myvalue, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function Savedb(newVal: any, valinitial: any) {
|
function Savedb(newVal: any, valinitial: any) {
|
||||||
|
|
||||||
if (props.col.fieldtype === costanti.FieldType.boolean) {
|
if (col.value.fieldtype === costanti.FieldType.boolean) {
|
||||||
// console.log('myvalue', myvalue, newVal, myvalueprec)
|
// console.log('myvalue', myvalue, newVal, myvalueprec)
|
||||||
if (myvalueprec.value === undefined) {
|
if (myvalueprec.value === undefined) {
|
||||||
newVal = true
|
newVal = true
|
||||||
@@ -227,9 +348,14 @@ export default defineComponent({
|
|||||||
// console.log('DOPO myvalue', myvalue, newVal, myvalueprec)
|
// console.log('DOPO myvalue', myvalue, newVal, myvalueprec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (col.value.fieldtype === costanti.FieldType.image) {
|
||||||
|
console.log('newVal.imagefile', newVal)
|
||||||
|
myvalue.value = newVal
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('Savedb', newVal)
|
// console.log('Savedb', newVal)
|
||||||
|
|
||||||
emit('showandsave', props.row, props.col, newVal, valinitial)
|
emit('showandsave', props.row, props.mycol, newVal, valinitial)
|
||||||
visueditor.value = false
|
visueditor.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,49 +364,59 @@ export default defineComponent({
|
|||||||
return
|
return
|
||||||
|
|
||||||
// let val = ''
|
// let val = ''
|
||||||
// if (props.col.subfield !== '') {
|
// if (col.subfield !== '') {
|
||||||
// if (row[props.col.field] === undefined)
|
// if (row[col.field] === undefined)
|
||||||
// row[props.col.field] = {}
|
// row[col.field] = {}
|
||||||
//
|
//
|
||||||
// val = row[props.col.field][props.col.subfield]
|
// val = row[col.field][col.subfield]
|
||||||
// } else {
|
// } else {
|
||||||
// val = row[props.col.field]
|
// val = row[col.field]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
if (props.col.fieldtype === costanti.FieldType.date) {
|
if (col.fieldtype === costanti.FieldType.date) {
|
||||||
if (val === undefined) {
|
if (val === undefined) {
|
||||||
return '[]'
|
return '[]'
|
||||||
} else {
|
} else {
|
||||||
return tools.getstrDateTime(val)
|
return tools.getstrDateTime(val)
|
||||||
}
|
}
|
||||||
} else if (props.col.fieldtype === costanti.FieldType.onlydate) {
|
} else if (col.fieldtype === costanti.FieldType.onlydate) {
|
||||||
if (val === undefined) {
|
if (val === undefined) {
|
||||||
return '[]'
|
return '[]'
|
||||||
} else {
|
} else {
|
||||||
return tools.getstrDate(val)
|
return tools.getstrDate(val)
|
||||||
}
|
}
|
||||||
} else if (props.col.fieldtype === costanti.FieldType.boolean) {
|
} else if (col.fieldtype === costanti.FieldType.boolean) {
|
||||||
return (val) ? t('dialog.yes') : t('dialog.no')
|
return (val) ? t('dialog.yes') : t('dialog.no')
|
||||||
} else if (props.col.fieldtype === costanti.FieldType.binary) {
|
} else if (col.fieldtype === costanti.FieldType.binary) {
|
||||||
if (val === undefined)
|
if (val === undefined)
|
||||||
return '[---]'
|
return '[---]'
|
||||||
else
|
else
|
||||||
return globalStore.getArrStrByValueBinary(col, val)
|
return globalStore.getArrStrByValueBinary(col, val)
|
||||||
} else if (props.col.fieldtype === costanti.FieldType.select) {
|
} else if (col.fieldtype === costanti.FieldType.select) {
|
||||||
if (val === undefined)
|
if (val === undefined)
|
||||||
return '[---]'
|
return '[---]'
|
||||||
else
|
else
|
||||||
return globalStore.getValueByTable(col, val)
|
return globalStore.getValueByTable(col, val)
|
||||||
} else if (props.col.fieldtype === costanti.FieldType.multiselect) {
|
} else if (col.fieldtype === costanti.FieldType.multiselect) {
|
||||||
if (val === undefined)
|
if (val === undefined)
|
||||||
return '[---]'
|
return '[---]'
|
||||||
else
|
else
|
||||||
return globalStore.getMultiValueByTable(col, val)
|
return globalStore.getMultiValueByTable(col, val)
|
||||||
|
} else if (col.fieldtype === costanti.FieldType.multioption) {
|
||||||
|
if (val === undefined)
|
||||||
|
return '[---]'
|
||||||
|
else
|
||||||
|
return globalStore.getMultiValueByTable(col, val)
|
||||||
|
} else if (col.fieldtype === costanti.FieldType.password) {
|
||||||
|
if (val === undefined)
|
||||||
|
return '[---]'
|
||||||
|
else
|
||||||
|
return '***************'
|
||||||
} else {
|
} else {
|
||||||
if (val === undefined || val === null)
|
if (val === undefined || val === null)
|
||||||
return '[]'
|
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||||
else if (val === '') {
|
else if (val === '') {
|
||||||
return '[]'
|
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||||
} else {
|
} else {
|
||||||
let mystr = ''
|
let mystr = ''
|
||||||
if (props.showall) {
|
if (props.showall) {
|
||||||
@@ -300,13 +436,13 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function visInNewRec(col: any) {
|
function visInNewRec(col: any) {
|
||||||
return !props.col.notShowInNewRec
|
return !col.notShowInNewRec
|
||||||
}
|
}
|
||||||
|
|
||||||
function getclassCol(col: any) {
|
function getclassCol(col: any) {
|
||||||
if (col) {
|
if (col) {
|
||||||
let mycl = (props.col.disable || isviewfield()) ? '' : 'colmodif'
|
let mycl = (col.disable || isviewfield()) ? '' : 'colmodif'
|
||||||
mycl += ((props.col.fieldtype === costanti.FieldType.date) || (props.col.fieldtype === costanti.FieldType.onlydate)) ? ' coldate flex flex-container' : ''
|
mycl += ((col.fieldtype === costanti.FieldType.date) || (col.fieldtype === costanti.FieldType.onlydate)) ? ' coldate flex flex-container' : ''
|
||||||
|
|
||||||
return mycl
|
return mycl
|
||||||
} else {
|
} else {
|
||||||
@@ -314,6 +450,12 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mycl() {
|
||||||
|
if (props.disable) {
|
||||||
|
return 'cldisable'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
// console.log(name, iso2, dialCode)
|
||||||
myvalueprec.value = myvalue.value
|
myvalueprec.value = myvalue.value
|
||||||
@@ -333,19 +475,44 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTitleGall() {
|
function getTitleGall() {
|
||||||
|
if (fieldsTable.tableForUsers.includes(props.table)) {
|
||||||
|
return 'Profilo'
|
||||||
|
} else {
|
||||||
return fieldsTable.getTitleImgByTable(props.table);
|
return fieldsTable.getTitleImgByTable(props.table);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function getDirectoryGall() {
|
function getDirectoryGall() {
|
||||||
if (fieldsTable.tableForUsers.includes(props.table)) {
|
if (fieldsTable.tableForUsers.includes(props.table)) {
|
||||||
return 'profile/' + userStore.my.username + '/' + props.table
|
return 'profile/' + userStore.my.username + '/' + props.table
|
||||||
|
}else if (props.table === 'users') {
|
||||||
|
return 'profile/' + userStore.my.username
|
||||||
} else {
|
} else {
|
||||||
return props.table
|
return props.table
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uploaded(info: any) {
|
||||||
|
|
||||||
|
if (info.files) {
|
||||||
|
myvalue.value = tools.geturlrelativeprofile()+ '/' + getMyUsername() + '/' + info.files[0].name
|
||||||
|
console.log('uploaded', myvalue.value)
|
||||||
|
savefield(myvalue.value, '', $q)
|
||||||
|
}
|
||||||
|
// info.files[0].name
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function removephoto() {
|
||||||
|
myvalue.value = ''
|
||||||
|
SaveValueInt(myvalue.value, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|
||||||
|
crea()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
myvalue,
|
myvalue,
|
||||||
countryname,
|
countryname,
|
||||||
@@ -357,7 +524,6 @@ export default defineComponent({
|
|||||||
changevalRecHours,
|
changevalRecHours,
|
||||||
updatedata,
|
updatedata,
|
||||||
OpenEdit,
|
OpenEdit,
|
||||||
getval,
|
|
||||||
SaveValueInt,
|
SaveValueInt,
|
||||||
annulla,
|
annulla,
|
||||||
Savedb,
|
Savedb,
|
||||||
@@ -373,6 +539,10 @@ export default defineComponent({
|
|||||||
globalStore,
|
globalStore,
|
||||||
getTitleGall,
|
getTitleGall,
|
||||||
getDirectoryGall,
|
getDirectoryGall,
|
||||||
|
removephoto,
|
||||||
|
isFieldDb,
|
||||||
|
col,
|
||||||
|
myImgGall,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.listimages">
|
<div v-else-if="col.fieldtype === costanti.FieldType.listimages">
|
||||||
Galleria:
|
gall1:
|
||||||
<CGallery
|
<CGallery
|
||||||
v-if="myvalue"
|
v-if="myvalue"
|
||||||
:title="getTitleGall()"
|
:title="getTitleGall()"
|
||||||
@@ -96,17 +96,44 @@
|
|||||||
</CGallery>
|
</CGallery>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
||||||
|
<div v-if="canEdit">
|
||||||
|
gall2:
|
||||||
<CGallery
|
<CGallery
|
||||||
v-if="myvalue"
|
v-if="myvalue"
|
||||||
:title="getTitleGall()"
|
:title="getTitleGall()"
|
||||||
:directory="getDirectoryGall()"
|
:directory="getDirectoryGall()"
|
||||||
:imgGall="myvalue" :edit="isviewfield()"
|
:imgGall="myvalue" :edit="isviewfield()"
|
||||||
|
:single="isFieldDb()"
|
||||||
@update:model-value="changevalRec"
|
@update:model-value="changevalRec"
|
||||||
@showandsave="Savedb">
|
@showandsave="Savedb">
|
||||||
|
|
||||||
</CGallery>
|
</CGallery>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div v-if="myvalue" class="text-center">
|
||||||
|
<q-img
|
||||||
|
:src="myvalue"
|
||||||
|
class="text-center"
|
||||||
|
style="height: 100px; width: 100px;"
|
||||||
|
alt="foto">
|
||||||
|
</q-img>
|
||||||
|
</div>
|
||||||
|
<div v-else class="text-center">
|
||||||
|
<q-img
|
||||||
|
src="images/noimg-user.svg"
|
||||||
|
class="text-center"
|
||||||
|
style="height: 100px; width: 100px;"
|
||||||
|
alt="nessuna immagine">
|
||||||
|
</q-img>
|
||||||
|
</div>
|
||||||
|
<q-btn
|
||||||
|
v-if="myvalue"
|
||||||
|
label="Rimuovi Foto"
|
||||||
|
color="blue" icon="fas fa-trash-alt" size="sm"
|
||||||
|
@click="removephoto"></q-btn>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="col.fieldtype === costanti.FieldType.binary">
|
<div v-if="col.fieldtype === costanti.FieldType.binary">
|
||||||
<CMyChipList
|
<CMyChipList
|
||||||
:type="costanti.FieldType.binary"
|
:type="costanti.FieldType.binary"
|
||||||
@@ -149,13 +176,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
||||||
<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true">
|
<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="col.fieldtype === costanti.FieldType.listimages">
|
<div v-if="col.fieldtype === costanti.FieldType.listimages">
|
||||||
|
gall3:
|
||||||
<CGallery
|
<CGallery
|
||||||
v-if="myvalue"
|
v-if="myvalue"
|
||||||
:title="getTitleGall()"
|
:title="getTitleGall()"
|
||||||
@@ -166,11 +193,13 @@
|
|||||||
</CGallery>
|
</CGallery>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
||||||
|
gall4:
|
||||||
<CGallery
|
<CGallery
|
||||||
v-if="myvalue"
|
v-if="myvalue"
|
||||||
:title="getTitleGall()"
|
:title="getTitleGall()"
|
||||||
:directory="getDirectoryGall()"
|
:directory="getDirectoryGall()"
|
||||||
:imgGall="myvalue" :edit="isviewfield()"
|
:single="isFieldDb()"
|
||||||
|
:imgGall="myImgGall" :edit="isviewfield()"
|
||||||
@showandsave="Savedb">
|
@showandsave="Savedb">
|
||||||
|
|
||||||
</CGallery>
|
</CGallery>
|
||||||
@@ -255,17 +284,10 @@
|
|||||||
@update:model-value="Savedb"></q-toggle>
|
@update:model-value="Savedb"></q-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
<div v-else-if="col.fieldtype === costanti.FieldType.html">
|
||||||
<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true">
|
<div v-if="isFieldDb()">
|
||||||
|
<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ visuValByType(myvalue, col, row) }}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="col.fieldtype === costanti.FieldType.html">
|
|
||||||
|
|
||||||
<q-dialog v-model="visueditor" no-backdrop-dismiss persistent full-height full-width>
|
<q-dialog v-model="visueditor" no-backdrop-dismiss persistent full-height full-width>
|
||||||
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;`">
|
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;`">
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
@@ -278,6 +300,10 @@
|
|||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<span v-html="visuValByType(myvalue, col, row)"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-popup-edit
|
<q-popup-edit
|
||||||
v-if="canEdit && col.fieldtype !== costanti.FieldType.html"
|
v-if="canEdit && col.fieldtype !== costanti.FieldType.html"
|
||||||
@@ -293,7 +319,7 @@
|
|||||||
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
||||||
<q-checkbox v-model="scope.value" :label="col.title">
|
<q-checkbox v-model="scope.value" :label="col.title">
|
||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
{{ visuValByType(myvalue, col, row) }}
|
<span v-html="visuValByType(myvalue, col, row)"></span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.string">
|
<div v-else-if="col.fieldtype === costanti.FieldType.string">
|
||||||
<q-input
|
<q-input
|
||||||
@@ -321,12 +347,22 @@
|
|||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.hours">
|
<div v-else-if="col.fieldtype === costanti.FieldType.hours">
|
||||||
|
<div v-if="isFieldDb()">
|
||||||
|
<CMySelect
|
||||||
|
label="Ore" v-model:value="myvalue"
|
||||||
|
optval="_id" optlab="label"
|
||||||
|
:useinput="false"
|
||||||
|
:options="tools.SelectHours">
|
||||||
|
</CMySelect>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
<q-input
|
<q-input
|
||||||
v-model="scope.value" type="number"
|
v-model="scope.value" type="number"
|
||||||
autofocus>
|
autofocus>
|
||||||
|
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.binary">
|
<div v-else-if="col.fieldtype === costanti.FieldType.binary">
|
||||||
|
|
||||||
<CMyToggleList
|
<CMyToggleList
|
||||||
@@ -354,6 +390,8 @@
|
|||||||
:readonly="true"
|
:readonly="true"
|
||||||
rounded dense
|
rounded dense
|
||||||
debounce="1000"
|
debounce="1000"
|
||||||
|
@keyup.enter="scope.set"
|
||||||
|
:label="title"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|||||||
@@ -1234,7 +1234,7 @@ export const fieldsTable = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
tableForUsers: [
|
tableForUsers: [
|
||||||
'myskills'
|
'myskills',
|
||||||
],
|
],
|
||||||
|
|
||||||
tablesList: [
|
tablesList: [
|
||||||
|
|||||||