Site Configuration by Server Params (confsites and confpages)

This commit is contained in:
Surya Paolo
2022-11-28 14:00:15 +01:00
parent fab0dbbb72
commit 58dc1dfdcc
76 changed files with 2504 additions and 5004 deletions

View File

@@ -18,6 +18,7 @@ import { CAccomodation } from '../CAccomodation'
import { tools } from '@store/Modules/tools'
import { costanti } from '@costanti'
// @ts-ignore
// import VueTelInput from 'vue3-tel-input'
// import 'vue3-tel-input/dist/vue3-tel-input.css'
@@ -237,17 +238,28 @@ export default defineComponent({
refresh()
})
const myrow = computed(() => {
return props.rec && props.isrec ? props.rec : props.row
watch(() => props.rec, (newval, oldval) => {
refresh()
})
const myrow = ref(<any>null)
/* const myrow = computed(() => {
return props.rec && props.isrec ? props.rec : props.row
})
*/
function crea() {
// console.log('crea', isFieldDb(), 'props.mycol', props.mycol)
if (props.mycol && props.mycol.name) {
if (props.mycol && props.mycol.name && props.mycol.name !== 'test') {
col.value = props.mycol
} else {
if (col.value.name === 'test') {
col.value.name = props.field
if (props.subfield) {
col.value.name += '.' + props.subfield
}
}
col.value.jointable = props.jointable
if (props.filter)
col.value.filter = props.filter
@@ -265,7 +277,7 @@ export default defineComponent({
myImgGall.value = [myvalue.value]
}
console.log('* col', col.value);
// console.log('* col', col.value);
}
if (props.type) {
@@ -282,6 +294,20 @@ export default defineComponent({
}
}
if (props.tablesel) {
// let obj = tools.getParamsByTable(props.table)
// console.log('OBJ:', obj)
if (true) {
console.log(' CAMPO', props.field + '.' + props.subfield)
let myval = tools.getLabelFooterByRow(myrow.value, props.field + '.' + props.subfield, props.table)
if (myval)
myvalue.value = myval
console.log(' RECORD INPUT', myrow.value)
console.log(' VALORE OUTPUT: ', myvalue.value)
}
}
// console.log('CMyFieldDb crea', myvalue)
}
@@ -317,7 +343,7 @@ export default defineComponent({
}
async function addNewValue(value: any) {
console.log('addNewValue', value, col.value)
// console.log('addNewValue', value, col.value)
if (col.value.allowNewValue && col.value.jointable) {
let myrec: any = {}
@@ -341,17 +367,18 @@ export default defineComponent({
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
myvalue.value = tools.removespaces_slash(newval)
}
// console.log('popypedit: changevalRec', newval)
// console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name)
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
// console.log('row[col.value.name]', props.row[col.value.name])
if (props.type === costanti.FieldType.image) {
// console.log('image', newval)
}
myrow.value[col.value.name] = newval
// console.log('changevalRec update:row', newval)
emit('update:row', props.row)
// console.log('changevalRec update:row', myrow.value)
emit('update:row', myrow.value)
if (props.isInModif)
OpenEdit()
}
@@ -371,11 +398,13 @@ export default defineComponent({
function mounted() {
myrow.value = props.rec && props.isrec ? {...props.rec} : {...props.row}
try {
// console.log('mounted', 'isFieldDb()', isFieldDb())
if (isFieldDb() && !props.isrec) {
// console.log(' . none...')
} else {
if (props.subfield !== '') {
if (myrow.value[props.field] === undefined) {
@@ -392,6 +421,7 @@ export default defineComponent({
myvalue.value = myrow.value
}
}
// console.log('props.field', props.field, 'props.subfield', props.subfield, 'myvalue: ', myvalue)
}
} catch (e) {
@@ -761,7 +791,6 @@ export default defineComponent({
myImgGall,
noPopupeditByCol,
getTitleEditor,
t,
myrow,
shared_consts,
}

View File

@@ -82,7 +82,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.username_chip">
<div class="q-ma-xs">
<span v-if="col.extrafield">
<span class="extrafield">{{ t(col.extrafield) }}</span>
<span class="extrafield">{{ $t(col.extrafield) }}</span>
</span>
<q-btn
v-if="col.tipovisu === costanti.TipoVisu.LINK && myvalue"
@@ -145,7 +145,7 @@
@keyup.enter.stop
@update:model-value="changevalRec"
autofocus
:label="col.visulabel ? t(col.label_trans) : col.label"
:label="col.visulabel ? $t(col.label_trans) : col.label"
>
</q-input>
</div>
@@ -156,7 +156,7 @@
<CLabel
v-bind="$attrs"
:value="myvalue"
:label="t(col.label_trans)"
:label="$t(col.label_trans)"
/>
</div>
<div v-else>
@@ -218,9 +218,9 @@
@update:model-value="Savedb"
:label="
col.visulabel
? t(col.label_trans)
? $t(col.label_trans)
: visulabel
? t(col.label_trans)
? $t(col.label_trans)
: ''
"
type="number"
@@ -233,7 +233,7 @@
:symbol="tools.getSymbolByCircuit(row)"
:color="tools.getColorByCircuit(row)"
:value="myvalue"
:label="t(col.label_trans)"
:label="$t(col.label_trans)"
>
</CCurrencyValue>
</div>
@@ -420,7 +420,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="myvalue"
@update:value="changevalRec"
:tablesel="tablesel"
@@ -452,7 +452,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="myvalue"
@update:value="changevalRec"
:tablesel="tablesel"
@@ -478,7 +478,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.date">
<div v-if="myvalue">
<CDateTime
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : (col.label_trans ? $t(col.label_trans) : '')"
class="cursor-pointer"
v-model:value="myvalue"
:readonly="false"
@@ -501,7 +501,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
class="cursor-pointer"
:valueDate="myvalue"
v-model:value="myvalue"
@@ -518,7 +518,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.binary">
<div v-if="isInModif">
<span v-if="insertMode">
{{ col.label ? col.label : t(col.label_trans) }}:
{{ col.label ? col.label : $t(col.label_trans) }}:
</span>
<CMyToggleList
:label="col.titlepopupedit ? col.titlepopupedit : ''"
@@ -566,7 +566,7 @@
:row="row"
:multiple="true"
:withToggle="true"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
:filter_table="col.filter_table"
:filter_field="col.filter_field"
:value_extra="value_extra"
@@ -660,7 +660,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="myvalue"
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
:tablesel="
@@ -669,6 +669,7 @@
: ''
"
@update:value="changevalRec"
@update:model-value="Savedb"
:newvaluefunc="addNewValue"
:filter_table="col.filter_table"
:addnone="col.addnone"
@@ -731,7 +732,7 @@
:col="col"
:row="row"
:multiselect_by_server="true"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:arrvalue="myvalue"
@update:arrvalue="changevalRec"
:addall="false"
@@ -770,7 +771,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="myvalue"
@update:value="changevalRec"
:filter_table="col.filter_table"
@@ -806,7 +807,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.html">
<div v-if="isInModif">
<q-bar v-if="isInModif" dense class="bg-primary text-white">
<span v-if="col.label_trans">{{ t(col.label_trans) }}</span
<span v-if="col.label_trans">{{ $t(col.label_trans) }}</span
><span v-else> {{ $t('event.testo_di_spiegazione') }}: </span>
<q-space />
</q-bar>
@@ -955,7 +956,7 @@
:maxlength="col.maxlength ? col.maxlength : undefined"
:minlength="col.minlength ? col.minlength : undefined"
v-model="scope.value"
:label="col.visulabel ? t(col.label_trans) : ''"
:label="col.visulabel ? $t(col.label_trans) : ''"
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
@keyup.enter.stop
autofocus
@@ -972,7 +973,7 @@
autofocus
:label="
col.visulabel
? t(col.label_trans)
? $t(col.label_trans)
: visulabel
? col.label
: ''
@@ -989,7 +990,7 @@
:symbol="tools.getSymbolByCircuit(row)"
:color="tools.getColorByCircuit(row)"
:value="scope.value"
:label="t(col.label_trans)"
:label="$t(col.label_trans)"
>
</CCurrencyValue>
</div>
@@ -1002,7 +1003,7 @@
autofocus
@update:model-value="changevalRec"
style="max-width: 100px"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
>
</q-input>
</div>
@@ -1043,7 +1044,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="scope.value"
:pickup="col.fieldtype === costanti.FieldType.select_by_server"
:addnone="col.addnone"
@@ -1080,7 +1081,7 @@
:col="col"
:row="row"
:multiselect_by_server="true"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:arrvalue="scope.value"
@update:arrvalue="changevalRec"
:addall="false"
@@ -1157,7 +1158,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="scope.value"
@update:value="changevalRec"
:tablesel="tablesel"
@@ -1179,7 +1180,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="scope.value"
@update:value="changevalRec"
:tablesel="tablesel"
@@ -1194,7 +1195,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.date">
<CDateTime
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : (col.label_trans ? $t(col.label_trans) : '')"
class="cursor-pointer"
v-model:value="myvalue"
:readonly="false"
@@ -1208,7 +1209,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
<CDateTime
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
class="cursor-pointer"
:valueDate="myvalue"
v-model:value="myvalue"
@@ -1249,7 +1250,7 @@
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label ? col.label : t(col.label_trans)"
:label="col.label ? col.label : $t(col.label_trans)"
v-model:value="scope.value"
:optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)"