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) {
|
||||
const recskills:any = searchList.value.find((rec) => rec.table === 'skills')
|
||||
// console.log('recSubSkill', recSubSkill, 'recskills', recskills)
|
||||
@@ -119,6 +115,7 @@ export default defineComponent({
|
||||
key: 'idCity',
|
||||
type: costanti.FieldType.multiselect_by_server,
|
||||
value: 0,
|
||||
addall: true,
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
|
||||
filter: null,
|
||||
useinput: true,
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
:label="labelcombo(item)"
|
||||
v-model:arrvalue="item.arrvalue"
|
||||
@update:arrvalue="searchval(item.arrvalue, item.table)"
|
||||
:addall="false"
|
||||
:addall="true"
|
||||
:tablesel="item.tablesel"
|
||||
:pickup="true"
|
||||
label-color="primary"
|
||||
|
||||
@@ -506,6 +506,7 @@
|
||||
</CMySelect>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
|
||||
myvalue2 : {{scope.value}}
|
||||
<CMySelect
|
||||
:multiselect_by_server="true"
|
||||
:label="col.label"
|
||||
|
||||
@@ -123,7 +123,7 @@ export default defineComponent({
|
||||
|
||||
watch(() => props.arrvalue, (value: any, oldval: any) => {
|
||||
console.log(' MODIF props.arrvalue', props.arrvalue)
|
||||
// mounted()
|
||||
mounted()
|
||||
},
|
||||
)
|
||||
|
||||
@@ -203,6 +203,16 @@ export default defineComponent({
|
||||
if (props.multiselect_by_server) {
|
||||
const num = parseInt(localStorage.getItem(props.tablesel + '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++) {
|
||||
const itemId = parseInt(localStorage.getItem(props.tablesel + i + props.optval)!)
|
||||
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
|
||||
@@ -210,7 +220,8 @@ export default defineComponent({
|
||||
let obj: any = {}
|
||||
obj[`${props.optval}`] = itemId
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -259,6 +276,15 @@ export default defineComponent({
|
||||
.then((ris) => {
|
||||
myarr = props.options
|
||||
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
|
||||
if (props.multiselect_by_server) {
|
||||
console.log('@@@ VALORI CHANGED (2)', valori.value)
|
||||
@@ -320,12 +346,6 @@ export default defineComponent({
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
if (!props.multiselect_by_server) {
|
||||
valori.value = valoriload.value
|
||||
console.log('@@@ VALORI CHANGED (4)', valori.value)
|
||||
} else {
|
||||
valori.value = arrtempOpt.value
|
||||
}
|
||||
|
||||
return {
|
||||
changeval,
|
||||
|
||||
Reference in New Issue
Block a user