corretto edit e newrecord Città
This commit is contained in:
@@ -51,10 +51,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFilterCities(recSkill: any, index: number, arr: any) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFilterSubSkills(recSubSkill: any, index: number, arr: any) {
|
function getFilterSubSkills(recSubSkill: any, index: number, arr: any) {
|
||||||
const recskills:any = searchList.value.find((rec) => rec.table === 'skills')
|
const recskills:any = searchList.value.find((rec) => rec.table === 'skills')
|
||||||
// console.log('recSubSkill', recSubSkill, 'recskills', recskills)
|
// console.log('recSubSkill', recSubSkill, 'recskills', recskills)
|
||||||
@@ -119,6 +115,7 @@ export default defineComponent({
|
|||||||
key: 'idCity',
|
key: 'idCity',
|
||||||
type: costanti.FieldType.multiselect_by_server,
|
type: costanti.FieldType.multiselect_by_server,
|
||||||
value: 0,
|
value: 0,
|
||||||
|
addall: true,
|
||||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
|
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
|
||||||
filter: null,
|
filter: null,
|
||||||
useinput: true,
|
useinput: true,
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
:label="labelcombo(item)"
|
:label="labelcombo(item)"
|
||||||
v-model:arrvalue="item.arrvalue"
|
v-model:arrvalue="item.arrvalue"
|
||||||
@update:arrvalue="searchval(item.arrvalue, item.table)"
|
@update:arrvalue="searchval(item.arrvalue, item.table)"
|
||||||
:addall="false"
|
:addall="true"
|
||||||
:tablesel="item.tablesel"
|
:tablesel="item.tablesel"
|
||||||
:pickup="true"
|
:pickup="true"
|
||||||
label-color="primary"
|
label-color="primary"
|
||||||
|
|||||||
@@ -506,6 +506,7 @@
|
|||||||
</CMySelect>
|
</CMySelect>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
|
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
|
||||||
|
myvalue2 : {{scope.value}}
|
||||||
<CMySelect
|
<CMySelect
|
||||||
:multiselect_by_server="true"
|
:multiselect_by_server="true"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
watch(() => props.arrvalue, (value: any, oldval: any) => {
|
watch(() => props.arrvalue, (value: any, oldval: any) => {
|
||||||
console.log(' MODIF props.arrvalue', props.arrvalue)
|
console.log(' MODIF props.arrvalue', props.arrvalue)
|
||||||
// mounted()
|
mounted()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -203,6 +203,16 @@ export default defineComponent({
|
|||||||
if (props.multiselect_by_server) {
|
if (props.multiselect_by_server) {
|
||||||
const num = parseInt(localStorage.getItem(props.tablesel + 'NUM')!)
|
const num = parseInt(localStorage.getItem(props.tablesel + 'NUM')!)
|
||||||
console.log('num LOADED ', num)
|
console.log('num LOADED ', num)
|
||||||
|
arrtempOpt.value = []
|
||||||
|
if (props.addall) {
|
||||||
|
let myobj: any = {}
|
||||||
|
if (typeof props.optlab === 'string') {
|
||||||
|
myobj[props.optlab] = '(Tutti)'
|
||||||
|
myobj[props.optval] = costanti.FILTER_TUTTI
|
||||||
|
}
|
||||||
|
|
||||||
|
arrtempOpt.value.push(myobj)
|
||||||
|
}
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
const itemId = parseInt(localStorage.getItem(props.tablesel + i + props.optval)!)
|
const itemId = parseInt(localStorage.getItem(props.tablesel + i + props.optval)!)
|
||||||
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
|
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
|
||||||
@@ -210,7 +220,8 @@ export default defineComponent({
|
|||||||
let obj: any = {}
|
let obj: any = {}
|
||||||
obj[`${props.optval}`] = itemId
|
obj[`${props.optval}`] = itemId
|
||||||
obj[`${props.optlab}`] = itemlab
|
obj[`${props.optlab}`] = itemlab
|
||||||
arrtempOpt.value.push(obj)
|
if (!arrtempOpt.value.find((rec) => rec._id === itemId))
|
||||||
|
arrtempOpt.value.push(obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +245,12 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
if (!props.multiselect_by_server) {
|
||||||
|
valori.value = valoriload.value
|
||||||
|
console.log('@@@ VALORI CHANGED (4)', valori.value)
|
||||||
|
} else {
|
||||||
|
valori.value = arrtempOpt.value
|
||||||
|
}
|
||||||
// console.log('cmyselect: myvalue.value', myvalue.value)
|
// console.log('cmyselect: myvalue.value', myvalue.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,6 +276,15 @@ export default defineComponent({
|
|||||||
.then((ris) => {
|
.then((ris) => {
|
||||||
myarr = props.options
|
myarr = props.options
|
||||||
if (ris) {
|
if (ris) {
|
||||||
|
if (props.addall) {
|
||||||
|
let myobj: any = {}
|
||||||
|
if (typeof props.optlab === 'string') {
|
||||||
|
myobj[props.optlab] = '(Tutti)'
|
||||||
|
myobj[props.optval] = costanti.FILTER_TUTTI
|
||||||
|
}
|
||||||
|
|
||||||
|
ris = [myobj, ...ris]
|
||||||
|
}
|
||||||
valori.value = ris
|
valori.value = ris
|
||||||
if (props.multiselect_by_server) {
|
if (props.multiselect_by_server) {
|
||||||
console.log('@@@ VALORI CHANGED (2)', valori.value)
|
console.log('@@@ VALORI CHANGED (2)', valori.value)
|
||||||
@@ -320,12 +346,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|
||||||
if (!props.multiselect_by_server) {
|
|
||||||
valori.value = valoriload.value
|
|
||||||
console.log('@@@ VALORI CHANGED (4)', valori.value)
|
|
||||||
} else {
|
|
||||||
valori.value = arrtempOpt.value
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
changeval,
|
changeval,
|
||||||
|
|||||||
Reference in New Issue
Block a user