- i filtri non venivano correttamente salvati sui cookies (compariva null e -100)

- aggiunte tabelle accounts e circuits
This commit is contained in:
Paolo Arena
2022-05-08 00:09:38 +02:00
parent 11acac03e5
commit b1fa4c4e2d
19 changed files with 350 additions and 65 deletions

View File

@@ -304,7 +304,7 @@ export default defineComponent({
label: 'Offro/Cerco',
table: 'adtypes',
key: 'adType',
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true),
arrvalue: [],
addall: true,
type: costanti.FieldType.select,
@@ -315,7 +315,7 @@ export default defineComponent({
label: 'Settore',
table: toolsext.TABSECTORS,
key: 'idSector',
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0, true),
arrvalue: [],
type: costanti.FieldType.select,
filter: null,
@@ -327,7 +327,7 @@ export default defineComponent({
label: 'Categoria',
table: 'skills',
key: 'idSkill',
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
arrvalue: [],
type: costanti.FieldType.select,
addall: true,
@@ -467,7 +467,7 @@ export default defineComponent({
label: 'Settore',
table: toolsext.TABSECTORS,
key: 'idSector',
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0, true),
arrvalue: [],
type: costanti.FieldType.select,
filter: null,
@@ -479,7 +479,7 @@ export default defineComponent({
label: 'Categoria',
table: 'skills',
key: 'idSkill',
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
arrvalue: [],
type: costanti.FieldType.select,
addall: true,
@@ -547,7 +547,7 @@ export default defineComponent({
table: toolsext.TABTYPEHOSP,
key: 'typeHosp',
type: costanti.FieldType.select,
value: tools.getCookie(tools.COOK_SEARCH + 'typeHosp', costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'typeHosp', costanti.FILTER_TUTTI, true),
addall: true,
arrvalue: [],
filter: null,
@@ -559,7 +559,7 @@ export default defineComponent({
table: toolsext.TABPEOPLE,
key: 'numMaxPeopleHosp',
type: costanti.FieldType.select,
value: tools.getCookie(tools.COOK_SEARCH + 'numMaxPeopleHosp', costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'numMaxPeopleHosp', costanti.FILTER_TUTTI, true),
addall: true,
arrvalue: [],
filter: null,
@@ -637,14 +637,14 @@ export default defineComponent({
label: 'Offro/Cerco',
table: 'adtypes',
key: 'adType',
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true),
arrvalue: [],
addall: true,
type: costanti.FieldType.select,
filter: null,
useinput: false,
},
{
/*{
label: 'Settore',
table: 'sectorgoods',
key: 'idSectorGood',
@@ -678,7 +678,7 @@ export default defineComponent({
addall: true,
filter: null,
useinput: false,
},
},*/
/*{
label: 'Specializzazione',
table: 'subskills',
@@ -1046,6 +1046,7 @@ export default defineComponent({
accomodation: 1,
preferences: 1,
idContribType: 1,
photos: 1,
idCity: 1,
note: 1,
website: 1,
@@ -1060,7 +1061,6 @@ export default defineComponent({
comune: 1,
mycities: 1,
'profile.img': 1,
'profile.qualifica': 1,
}
},
}

View File

@@ -399,7 +399,7 @@ export default defineComponent({
setCategBySector(toolsext.TABSKILLS, table, newval)
} else if (table === toolsext.TABREGIONS) {
setProvinceByRegion(toolsext.TABPROVINCE, table, newval)
}else if (table === 'goods') {
} else if (table === 'goods') {
setCategBySector('sectorgoods', table, newval)
}
@@ -1303,35 +1303,37 @@ export default defineComponent({
colVisib.value = []
let elem: IColGridTable
for (elem of mycolumns.value) {
if (elem.field !== costanti.NOFIELD) {
if (checkIfColShow(elem.field)) {
colVisib.value.push(elem.field! + elem.subfield!)
if (tools.isArray(mycolumns.value)) {
for (elem of mycolumns.value) {
if (elem.field !== costanti.NOFIELD) {
if (checkIfColShow(elem.field)) {
colVisib.value.push(elem.field! + elem.subfield!)
}
}
}
}
if (!!myselcol && myselcol.length > 0) {
const arrselcol = myselcol.split('|')
if (!!myselcol && myselcol.length > 0) {
const arrselcol = myselcol.split('|')
for (const col of arrselcol) {
const arrv = col.split(',')
if (arrv.length > 1) {
let field = arrv[0]
let visib = arrv[1]
const rec = mycolumns.value.find((rec: any) => (rec.field + rec.subfield) === field)
for (const col of arrselcol) {
const arrv = col.split(',')
if (arrv.length > 1) {
let field = arrv[0]
let visib = arrv[1]
const rec = mycolumns.value.find((rec: any) => (rec.field + rec.subfield) === field)
if (rec) {
if (field) {
if (visib === '1') {
if (!colVisib.value.includes(field))
colVisib.value.push(field) // se non incluso allora lo aggiungi
} else if (visib === '0') {
// Se da togliere, lo togli
if (colVisib.value.includes(field))
colVisib.value = colVisib.value.filter((rec: any) => rec !== field)
if (rec) {
if (field) {
if (visib === '1') {
if (!colVisib.value.includes(field))
colVisib.value.push(field) // se non incluso allora lo aggiungi
} else if (visib === '0') {
// Se da togliere, lo togli
if (colVisib.value.includes(field))
colVisib.value = colVisib.value.filter((rec: any) => rec !== field)
}
}
}
}

View File

@@ -208,8 +208,8 @@ export default defineComponent({
}
function setCmd($q: any, cmd: number, usernameDest: string, value: any, groupname: string) {
tools.setCmd($q, cmd, username.value, value, usernameDest)
function setCmd($q: any, cmd: number, username: string, value: any, usernameDest: string) {
tools.setCmd($q, cmd, username, value, usernameDest)
if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
setRequestTrust(usernameDest, value)

View File

@@ -24,7 +24,7 @@ export default defineComponent({
return []
}
},
value: [String, Number],
value: [String, Number, Object],
label: {
type: String,
required: true,
@@ -152,7 +152,7 @@ export default defineComponent({
const optFiltered = ref(<any>[])
const valori = ref(<any>[])
const myvalue = ref(<string | number>'')
const myvalue = ref(<string | number | object>'')
const myarrvalue = ref(<any[]>[])
const arrtempOpt = ref(<any[]>[])
@@ -199,7 +199,7 @@ export default defineComponent({
if (!num) {
num = 0
} else {
num = parseInt(num.toString())
num = parseInt(num.toString(), 10)
}
} catch (e) {
num = 0
@@ -268,7 +268,7 @@ export default defineComponent({
}
function update() {
console.log('update')
console.log('update', props.value, props)
// console.log(' #### mounted myselect', props.options, 'arrvalue', myarrvalue.value)
let rec: any
if (optionsreal.value) {
@@ -277,7 +277,7 @@ export default defineComponent({
}
}
if (props.multiselect_by_server) {
const num = parseInt(localStorage.getItem(props.tablesel + 'NUM')!)
const num = parseInt(localStorage.getItem(props.tablesel + 'NUM')!, 10)
// console.log('num LOADED ', num)
arrtempOpt.value = []
if (props.addall) {
@@ -299,7 +299,7 @@ export default defineComponent({
arrtempOpt.value = [myobj, ...arrtempOpt.value]
}
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)!, 10)
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
if (itemId) {
let obj: any = {}
@@ -403,6 +403,7 @@ export default defineComponent({
}
function updateArrOptions() {
let myarr: any = []
// console.log(props.col.jointable, props.filter)

View File

@@ -252,7 +252,7 @@ export default defineComponent({
isalreadyReg.value = await tools.registeredusername(signup.username);
signup.profile.username_telegram = signup.username
if (!!$route.params.idteleg) {
signup.profile.teleg_id = $route.params.idteleg ? parseInt($route.params.idteleg.toString()) : 0
signup.profile.teleg_id = $route.params.idteleg ? parseInt($route.params.idteleg.toString(), 10) : 0
}
console.log('1) aportador_solidario', signup.aportador_solidario)