Table MySkills

This commit is contained in:
Paolo Arena
2021-10-08 00:38:22 +02:00
parent eb4156fc89
commit 48128235f8
22 changed files with 1250 additions and 1184 deletions

View File

@@ -267,31 +267,96 @@ export const colTableStorehouse = [
]
export const colSectors = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colLevels = [
AddCol({ name: '_id', label_trans: 'index' }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'years_of_exp', label_trans: 'years_of_exp', fieldtype: costanti.FieldType.number }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colSkills = [
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol({
name: 'idSector',
label_trans: 'sectors.name',
fieldtype: costanti.FieldType.select,
jointable: 'sectors',
}),
AddCol({ name: 'main', label_trans: 'store.main', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colLevels = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'years_of_exp', label_trans: 'years_of_exp', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colCitys = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'comune', label_trans: 'city.comune' }),
AddCol({ name: 'prov', label_trans: 'city.prov' }),
AddCol({ name: 'reg', label_trans: 'city.reg' }),
AddCol({ name: 'pref', label_trans: 'city.pref' }),
AddCol({ name: 'cap', label_trans: 'city.cap' }),
AddCol({ name: 'abitanti', label_trans: 'city.abitanti', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'country', label_trans: 'city.country' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colSkills = [
// AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol({
name: 'idSector',
label_trans: 'sectors.name',
fieldtype: costanti.FieldType.multiselect,
jointable: 'sectors',
}),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colmySkills = [
//AddCol({
// name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
//}),
AddCol({
name: 'idSkill',
label_trans: 'skill.name',
fieldtype: costanti.FieldType.select,
jointable: 'skills',
}),
AddCol({
name: 'numLevel',
label_trans: 'level.name',
fieldtype: costanti.FieldType.select,
jointable: 'levels',
}),
AddCol({
name: 'idStatusSkill',
label_trans: 'statusSkill.name',
fieldtype: costanti.FieldType.multiselect,
jointable: 'statusSkills',
}),
AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colStatusSkills = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
@@ -1353,6 +1418,13 @@ export const fieldsTable = {
colkey: 'key',
collabel: 'key',
},
{
value: 'myskills',
label: 'Mie Competenze',
columns: colmySkills,
colkey: '_id',
collabel: (rec: any) => `${rec.name} ${rec.surname}`,
},
{
value: 'skills',
label: 'Competenze',
@@ -1360,6 +1432,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'descr',
},
{
value: 'statusSkills',
label: 'Stato Attuale',
columns: colStatusSkills,
colkey: '_id',
collabel: 'descr',
},
{
value: 'sectors',
label: 'Settori',
@@ -1374,6 +1453,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'descr',
},
{
value: 'citys',
label: 'Città',
columns: colCitys,
colkey: '_id',
collabel: 'comune',
},
],
}

View File

@@ -134,7 +134,7 @@ export const toolsext = {
// this.$q.lang.set(mylang)
},
getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: string, id?: any, idmain?: any): any | undefined {
getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: string, id?: any, idmain?: any, indrec?: number, subsubkey?: string): any | undefined {
const todos = useTodoStore()
const userStore = useUserStore()
@@ -143,8 +143,13 @@ export const toolsext = {
if (keystr === 'profile') {
if (subkey) {
// console.log('userStore.my.profile', userStore.my.profile, 'subkey', subkey, )
// @ts-ignore
return userStore.my.profile[subkey]
if (subsubkey && indrec) {
// @ts-ignore
return userStore.my.profile[subkey][indrec][subsubkey]
} else {
// @ts-ignore
return userStore.my.profile[subkey]
}
}
} else if (keystr) { // @ts-ignore
// @ts-ignore

View File

@@ -118,6 +118,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
URL_RESTORE: '',
levels: [],
skills: [],
statusSkills: [],
sectors: [],
}),
@@ -224,6 +225,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
return state.levels
else if (table === 'skills')
return state.skills
else if (table === 'statusSkills')
return state.statusSkills
else if (table === 'sectors')
return state.sectors
else return ris
@@ -759,6 +762,19 @@ export const useGlobalStore = defineStore('GlobalStore', {
})
},
async saveSubRec(mydata: any) {
// console.log('saveTable', mydata)
const userStore = useUserStore()
return Api.SendReq('/setsubrec', 'POST', mydata)
.then((res) => res.data)
.catch((error) => {
console.log('error saveSubRec', error)
userStore.setErrorCatch(error)
return null
})
},
async saveFieldValue(mydata: IDataToSet) {
// const userStore = useUserStore()
return Api.SendReq('/chval', 'PATCH', { data: mydata })
@@ -1110,6 +1126,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.departments = (res.data.departments) ? [...res.data.departments] : []
this.levels = (res.data.levels) ? [...res.data.levels] : []
this.skills = (res.data.skills) ? [...res.data.skills] : []
this.statusSkills = (res.data.statusSkills) ? [...res.data.statusSkills] : []
this.sectors = (res.data.sectors) ? [...res.data.sectors] : []
// console.log('res.data.cart', res.data.cart)