- Gruppi (2)

This commit is contained in:
paoloar77
2022-02-04 23:48:53 +01:00
parent 45a771fab2
commit 498c28773f
26 changed files with 332 additions and 67 deletions

View File

@@ -81,9 +81,10 @@ export const shared_consts = {
PARAM_SHOW_PROVINCE: 1,
TABLES_ID_NUMBER: ['permissions', 'levels', 'statusSkills', 'sectors', 'skills', 'subskills', 'cities', 'provinces', 'myskills'],
TABLES_ID_NUMBER: ['permissions', 'levels', 'statusSkills', 'sectors', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', 'myskills', 'mygroups'],
TABLES_USER_ID: ['myskills'],
TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybots'],
TABLES_FINDER: ['myskills', 'mygroups'],
TABLES_PERM_CHANGE_FOR_USERS: ['myskills'],
@@ -687,15 +688,13 @@ export const shared_consts = {
VisibilGroup: [
{
value: 1,
label: 'Pubblico',
label: 'Riservato',
hint: 'Per accedere al gruppo, verrà richiesto la password'
},
{
value: 2,
label: 'Privato',
},
{
value: 4,
label: 'Nascosto',
hint: 'il Gruppo non sarà visibile nella ricerca'
},
],

View File

@@ -5,6 +5,8 @@ import { tools } from '../../store/Modules/tools'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { shared_consts } from '@/common/shared_vuejs'
import {
IColGridTable,
IFilter,
@@ -313,6 +315,15 @@ export default defineComponent({
function canModifyThisRec(rec: any) {
// console.log('rec', rec)
if (tablesel.value === 'mygroups') {
// is Admin ?
const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username)
if (trovato) {
return !!trovato
}
}
if (rec.hasOwnProperty('userId')) {
let userId = rec.userId
if (userId === userStore.my._id) {
@@ -819,6 +830,8 @@ export default defineComponent({
await createNewRecordDialog()
console.log('newRecord.value', newRecord.value)
serverData.value.push(newRecord.value)
pagination.value.rowsNumber++
@@ -882,6 +895,7 @@ export default defineComponent({
function exec_func_table(table: string, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE_RECTABLE) {
globalStore.DeleteRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
@@ -1149,10 +1163,29 @@ export default defineComponent({
return ok
}
function getColMissing() {
let col: IColGridTable
for (col of mycolumns.value) {
if (col.required) {
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name])
if (!newRecord.value[col.name]) {
// console.log('col.name', col.name)
return translate(col.label_trans)
}
}
}
return ''
}
async function saveNewRecord() {
// check if the field are setted
if (!enableSaveNewRec()) {
tools.showNeutralNotif($q, 'Si prega di compilare il campo \'' + getColMissing() + '\'', 5000)
return false
}
@@ -1243,10 +1276,21 @@ export default defineComponent({
return ((rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number') && rec !== -100
}
function showColCheck(col: IColGridTable, tipovis: number, visulabel:boolean, value: any = ''){
function showColCheck(col: IColGridTable, tipovis: number, visulabel:boolean, value: any = '', record: any = null){
const check = tools.checkIfShowField(col, tipovis, visulabel, value)
const valuePresent = (colVisib.value.includes(col.field! + col.subfield) || colVisib.value.includes(col.field + '.' + col.subfield))
let valuePresent = (colVisib.value.includes(col.field! + col.subfield) || colVisib.value.includes(col.field + '.' + col.subfield))
if (valuePresent && col.visibleif! > 0 && record) {
if (col.visib_field) {
if (col.visibleif === costanti.BINARY_CHECK) {
if (!tools.isBitActive(record[col.visib_field], col.visib_value))
valuePresent = false
}
}
}
return check && valuePresent
}
@@ -1337,6 +1381,7 @@ export default defineComponent({
myvertical,
showColCheck,
getValueExtra,
shared_consts,
}
}
})

View File

@@ -13,7 +13,7 @@
<q-space></q-space>
<div v-if="butt_modif_new">
<q-btn
v-if="mytable && mytable !== 'myskills'" rounded dense size="sm" flat
v-if="mytable && !shared_consts.TABLES_FINDER.includes(mytable)" rounded dense size="sm" flat
:color="canEdit ? 'positive' : 'light-gray'"
:disable="disabilita()"
:val="lists.MenuAction.CAN_EDIT_TABLE"
@@ -105,7 +105,7 @@
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `">
<span v-for="(item, index) in searchList" :key="index">
<CMySelect
:col="fieldsTable.getColByTable('myskills', item.key)"
:col="fieldsTable.getColByTable(mytable, item.key)"
v-if="(item.type === costanti.FieldType.select) || (item.type === costanti.FieldType.select_by_server)"
:label="labelcombo(item)"
v-model:value="item.value"
@@ -129,7 +129,7 @@
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:col="fieldsTable.getColByTable('myskills', item.key)"
:col="fieldsTable.getColByTable(mytable, item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@@ -261,7 +261,7 @@
<q-td
v-for="col in mycolumns" :key="col.name" :props="props">
<div
v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1)" class="tdclass">
v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)" class="tdclass">
<div :class="getclrow(props.row)">
<CMyPopupEdit
:table="mytable"
@@ -331,6 +331,7 @@
<q-bar v-if="!visuinpage" dense class="bg-primary text-white full-height">
<span class=""> {{ props.row[col_title] }} </span>
<q-space/>
<q-btn
v-if="canModifyThisRec(props.row)"
flat round color="white" icon="fas fa-pencil-alt" size="sm"
@@ -444,7 +445,7 @@
<div
v-for="col in mycolumns" :key="col.name" class="newrec_fields">
<div
v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true) && col.foredit">
v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) && col.foredit">
<div class="">
<CMyPopupEdit
:table="mytable"

View File

@@ -16,6 +16,10 @@ export default defineComponent({
type: Number,
required: true,
},
type_out: {
type: Number,
required: false,
},
optlab: {
type: String,
required: true,
@@ -66,9 +70,20 @@ export default defineComponent({
console.log('optlab', props.optlab)
console.log('myval.value', myval.value)
console.log('rec[props.optval]', rec[props.optval])
*/
let trovato = false
if (props.type_out === costanti.FieldType.object) {
// @ts-ignore
if (myval.value.includes(rec[props.optval])) {
trovato = myval.value.find((recout) => recout[props.optval] === rec[props.optval])
} else {
// @ts-ignore
trovato = myval.value.includes(rec[props.optval])
}
if (trovato) {
const mydata: any = {
label: null,
value: rec[props.optval],

View File

@@ -2,7 +2,7 @@
import { tools } from '@store/Modules/tools'
import { CTitleBanner } from '../CTitleBanner'
import { defineComponent, ref, toRef } from 'vue'
import { defineComponent, onMounted, ref, toRef } from 'vue'
import { useQuasar } from 'quasar'
export default defineComponent({
@@ -38,7 +38,8 @@ export default defineComponent({
const $q = useQuasar()
const editor = ref(null)
const myvalue = toRef(props, 'value')
//const myvalue = toRef(props, 'value')
const myvalue = ref('')
const mycolor = ref('')
const showeditor= ref(true)
@@ -163,6 +164,15 @@ export default defineComponent({
// }
}
function mounted() {
if (props.value === undefined)
myvalue.value = ''
else
myvalue.value = props.value
}
onMounted(mounted)
return {
myfonts,
toolbarcomp,

View File

@@ -23,6 +23,7 @@
</q-popup-proxy>
</q-icon>
</q-btn>
<q-editor
ref="editor"
content-class="wrap_anywhere"

View File

@@ -8,9 +8,9 @@
</q-item-section>
<q-item-section @click="naviga(`/grp/` + grp.groupname)">
<q-item-label><strong>{{ grp.name }} {{ grp.surname }}</strong> ({{ grp.groupname }})
<q-item-label><strong>{{ grp.title }}</strong> ({{ grp.groupname }})
</q-item-label>
<q-item-label v-if="grp.profile" caption lines="1"><em>{{ grp.profile.qualifica }}</em></q-item-label>
<q-item-label v-if="grp.descr" caption lines="1"><em>{{ grp.descr }}</em></q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.MY_GROUPS">

View File

@@ -52,9 +52,9 @@ export default defineComponent({
let arr: any[] = []
try {
if (props.modelValue === costanti.GROUPS) {
arr = userStore.my.profile.groups
arr = userStore.my.profile.mygroups
} else if (props.modelValue === costanti.MY_GROUPS) {
arr = userStore.my.profile.groups
arr = userStore.my.profile.mygroups
// } else if (props.modelValue === costanti.REQ_GROUP) {
// arr = userStore.my.profile.req_groups
} else if (props.modelValue === costanti.ASK_SENT_GROUP) {
@@ -82,7 +82,7 @@ export default defineComponent({
})
const numGroups = computed(() => {
const arr = userStore.my.profile.groups
const arr = userStore.my.profile.mygroups
return (arr) ? arr.length : 0
})
@@ -97,7 +97,7 @@ export default defineComponent({
userStore.loadGroups(username.value).then((ris) => {
// console.log('ris', ris)
if (ris) {
userStore.my.profile.groups = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.my.profile.mygroups = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.groups = ris.listgroups ? ris.listgroups : []
userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : []
filtroutente.value = [{ userId: userStore.my._id }]
@@ -117,7 +117,7 @@ export default defineComponent({
userStore.setGroupsCmd($q, t, username.value, groupnameDest, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, null).then((res) => {
if (res) {
userStore.my.profile.groups = userStore.my.profile.groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
tools.showPositiveNotif($q, t('db.removedgroup'))
}
})
@@ -133,7 +133,7 @@ export default defineComponent({
}).onOk(() => {
userStore.setGroupsCmd($q, t, username.value, usernameDest, shared_consts.GROUPSCMD.BLOCK_GROUP, null).then((res) => {
if (res) {
userStore.my.profile.groups = userStore.my.profile.groups.filter((rec: IMyGroup) => rec.groupname !== usernameDest)
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== usernameDest)
tools.showPositiveNotif($q, t('db.blockedgroup'))
}
})

View File

@@ -15,7 +15,6 @@
/>
</div>
<div v-if="finder" class="">
<div v-if="modelValue === costanti.FIND_GROUP">
<slot></slot>
</div>

View File

@@ -273,6 +273,9 @@ export default defineComponent({
}
function changevalRec(newval: any) {
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
myvalue.value = tools.removespaces(newval)
}
console.log('popypedit: changevalRec', newval)
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
// console.log('row[col.value.name]', props.row[col.value.name])
@@ -280,6 +283,7 @@ export default defineComponent({
// console.log('image', newval)
}
myrow.value[col.value.name] = newval
// console.log('changevalRec update:row', newval)
emit('update:row', props.row)
if (props.isInModif)
@@ -590,13 +594,13 @@ export default defineComponent({
function getDirectoryGall() {
let ris = ''
if (fieldsTable.tableForUsers.includes(props.table)) {
console.log('1')
ris = 'profile/' + myrow.value['username'] + '/' + props.table
}else if (props.table === 'users') {
console.log('2')
ris = 'profile/' + userStore.my.username
}else if (props.table === 'mygroups') {
if (myrow.value.hasOwnProperty('groupname'))
ris = 'mygroups/' + myrow.value['groupname']
} else {
console.log('3')
ris = props.table
}
return ris
@@ -639,6 +643,16 @@ export default defineComponent({
}
function getToByCol(col: IColGridTable){
if (props.table === 'myskills') {
return '/mypage/'+ props.row['_id']
} else if (props.table === 'mygroups') {
return '/grp/' + props.row['groupname']
}
return ''
}
onBeforeMount(mounted)
crea()
@@ -677,6 +691,7 @@ export default defineComponent({
myImgGall,
noPopupeditByCol,
getTitleEditor,
getToByCol,
}
}
})

View File

@@ -30,17 +30,18 @@
@update:model-value="Savedb"></q-toggle>
</div>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.string">
<div v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted">
<div v-if="visulabel || isInModif" :class="{ flex: !isInModif}">
<q-input
v-bind="$attrs"
v-model="myvalue"
autogrow
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
:style="$q.screen.lt.sm ? 'min-width: 300px' : ''"
counter
:maxlength="col.maxlength ? col.maxlength : undefined"
:disable="disable"
:readonly="disable"
:type="col.fieldtype === costanti.FieldType.crypted ? `password` : `text`"
@keyup.enter.stop
@update:model-value="changevalRec"
autofocus
@@ -85,6 +86,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.hours">
<div v-if="isFieldDb()">
<CMySelect
:type_out="col.field_outtype"
label="Ore"
v-model:value="myvalue"
@update:value="changevalRec"
@@ -159,6 +161,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.nationality">
<div v-if="isInModif" class="justify-center q-gutter-sm clgutter q-mt-sm">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -179,6 +182,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.intcode">
<div v-if="isInModif" class="justify-center q-gutter-sm clgutter q-mt-sm">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -254,6 +258,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect">
<div v-if="isInModif">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:multiple="true"
@@ -309,6 +314,7 @@
<div v-else>
<CMyChipList
:type="col.fieldtype"
:type_out="col.field_outtype"
@update:value="changevalRec"
:value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
@@ -321,6 +327,7 @@
v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<div v-if="isInModif">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -342,6 +349,7 @@
<CMyChipList
myclass="text-center"
:type="col.fieldtype"
:type_out="col.field_outtype"
@update:value="changevalRec"
v-model:value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable, col.addall, col.filter)"
@@ -352,6 +360,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:multiselect_by_server="true"
@@ -377,6 +386,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.star5">
<div v-if="isInModif">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -432,7 +442,7 @@
<q-btn
v-if="myvalue && col.field_extra1"
icon="far fa-file-alt" :label="col.titlepopupedit" color="primary" text-color="white"
:to="`/mypage/`+row['_id']"
:to="getToByCol(col)"
>
</q-btn>
</div>
@@ -503,13 +513,14 @@
</q-checkbox>
<span v-html="visuValByType(myvalue, col, row)"></span>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.string">
<div v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted">
<q-input
v-bind="$attrs"
counter
:type="col.fieldtype === costanti.FieldType.crypted ? 'password' : 'text'"
:maxlength="col.maxlength ? col.maxlength : undefined"
v-model="scope.value"
autogrow
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
@keyup.enter.stop
autofocus>
@@ -540,6 +551,7 @@
</div>
<div v-if="isFieldDb()">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
label="Ore" v-model:value="myvalue"
@@ -563,6 +575,7 @@
<div
v-else-if="(col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.select_by_server)">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -581,6 +594,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect_by_server">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:multiselect_by_server="true"
@@ -637,6 +651,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.nationality">
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -657,6 +672,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.intcode">
<div class="justify-center q-gutter-sm clgutter q-mt-sm">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"
@@ -683,6 +699,7 @@
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.star5">
<CMySelect
:type_out="col.field_outtype"
:col="col"
:row="row"
:label="col.label"

View File

@@ -2,3 +2,8 @@
display: flex;
flex: 1;
}
.hint{
color: gray;
font-style: italic;
}

View File

@@ -39,10 +39,9 @@ export default defineComponent({
required: false,
default: ''
},
type: {
type_out: {
type: Number,
required: false,
default: 0
},
row: {
type: Object,
@@ -210,7 +209,24 @@ export default defineComponent({
console.log(' ½½½½½½½ changeval', newval)
if (props.multiple || props.multiselect_by_server) {
// localStorage.setItem(props.tablesel + '_' + newval, valori.value[newval])
if (props.type_out === costanti.FieldType.object) {
// debugger;
const arrout = []
for (const val of newval) {
let obj: any = {}
if (typeof val !== 'object') {
obj[props.optval] = val
arrout.push(obj)
} else {
arrout.push(val)
}
}
myarrvalue.value = arrout
} else {
myarrvalue.value = newval && newval['arrvalue'] ? newval['arrvalue'] : newval
}
saveOptInCookie(newval)
// console.log(' ----- Myselect changeval Arrvalue', myarrvalue.value)
@@ -303,15 +319,22 @@ export default defineComponent({
}
}
if (props.tablesel === 'friendsandme') {
debugger;
}
if (props.multiple) {
let arrrec = []
if (props.arrvalue) {
for (const val of props.arrvalue) {
rec = optionsreal.value.find((myrec: any) => val === (myrec[`${props.optval}`]))
if (rec) {
arrrec.push(rec[`${props.optval}`])
}
}
if (arrrec) {
}
if (arrrec.length > 0) {
if (props.funcgetvaluebyid)
myarrvalue.value = props.funcgetvaluebyid(arrrec)
else

View File

@@ -159,6 +159,7 @@
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[optlab] }}</q-item-label>
<q-item-label v-if="'hint' in opt" class="hint">{{ opt['hint'] }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle :model-value="selected" @update:value="toggleOption(opt)"/>
@@ -200,6 +201,7 @@
</q-item-section>
<q-item-section>
<q-item-label>{{ scope.opt[optlab] }}</q-item-label>
<q-item-label v-if="'hint' in scope.opt" class="hint">{{ scope.opt['hint'] }}</q-item-label>
</q-item-section>
</q-item>
</template>

View File

@@ -1,5 +1,5 @@
import { IAction } from '@src/model/Projects'
import { IPaymentType } from '@src/model/UserStore'
import { IMyGroup, IPaymentType } from '@src/model/UserStore'
import {
IDepartment, IProducer, IShareWithUs, IStorehouse,
} from '@src/model/Products'
@@ -261,6 +261,7 @@ export interface IGlobalState {
subSkills: ISubSkill[],
statusSkills: IStatusSkill[],
sectors: ISector[],
catgrps: ICatGrp[],
cities: ICity[],
}
@@ -484,6 +485,9 @@ export interface IColGridTable {
required?: boolean
label?: string
label_trans?: string
visibleif?: number
visib_field?: string
visib_value?: any
align?: string
field?: string
sortable?: boolean
@@ -495,6 +499,7 @@ export interface IColGridTable {
askaction?: string
foredit?: boolean
fieldtype?: number
field_outtype?: number
noshowlabel?: boolean
tipovisu?: number
link?: string
@@ -506,6 +511,7 @@ export interface IColGridTable {
notsave?: boolean
showWhen?: number
maxlength?: number
allowchar?: number
filter_table?: string
filter_field?: string
remote_table?: string
@@ -633,6 +639,16 @@ export interface ISector {
theme: string
}
export interface ICatGrp {
_id: number
descr: string
idCatGrp?: number
icon?: string
img?: string
color: string
theme: string
}
export interface ILevel {
_id: number
descr: string

View File

@@ -1,6 +1,6 @@
import { IToken } from '@model/other'
import { ICart, IOrderCart, IShareWithUs } from '@src/model/Products'
import { IGallery } from '@model/GlobalStore'
import { IGallery, IImgGallery } from '@model/GlobalStore'
const enum ESexType {
None = 0,
@@ -17,7 +17,7 @@ export interface IMyGroup {
groupname: string
title?: string
descr?: string
photos: IGallery[]
photos: IImgGallery[]
visibility?: number
date_created?: Date
admins?: IFriends[]
@@ -69,7 +69,7 @@ export interface IUserProfile {
myshares: IShareWithUs[]
friends: IFriends[]
req_friends: IFriends[]
groups: IMyGroup[]
mygroups: IMyGroup[]
// in memory
asked_friends: any[]

View File

@@ -502,6 +502,7 @@ const msg_it = {
photo: 'Foto',
images: 'Immagini',
image: 'Immagine',
date_created: 'Creato il',
err: {
required: 'è richiesto',
email: 'inserire una email valida',
@@ -841,6 +842,9 @@ const msg_it = {
sectors: {
name: 'Settore',
},
catgrps: {
name: 'Categoria',
},
contribtype: {
name: 'Contributo'
},
@@ -890,6 +894,7 @@ const msg_it = {
block_group: 'Blocca Gruppo',
cancel_ask_group: 'Annulla la richiesta',
cancel_ask_group_short: 'Annulla richiesta',
pwd: 'Password per accedere',
}
},

View File

@@ -11,6 +11,11 @@ export const costanti = {
SHOW_USERINFO: 1,
SHOW_GROUPINFO: 5,
BINARY_CHECK: 1,
RISERVATO_PASSWORD: 1,
NASCOSTO_CERCA: 2,
VISUTABLE_SCHEDA_USER: -1,
VISUTABLE_SCHEDA_GROUP: -3,
@@ -42,6 +47,8 @@ export const costanti = {
DRAGULA: false,
ALLOWCHAR_CODE: 1,
showWhen: {
NewRec: 1,
InPage: 2,
@@ -84,6 +91,7 @@ export const costanti = {
onlydate: 7000,
hours: 8000,
crypted: 9000,
object: 10000,
},
FieldTypeArr: [

View File

@@ -48,6 +48,9 @@ function AddCol(params: IColGridTable) {
required: (params.required === undefined) ? false : params.required,
label: (params.label === undefined) ? '' : params.label,
label_trans: (params.label_trans === undefined) ? '' : params.label_trans,
visibleif: (params.visibleif === undefined) ? 0 : params.visibleif,
visib_field: (params.visib_field === undefined) ? '' : params.visib_field,
visib_value: (params.visib_value === undefined) ? '' : params.visib_value,
align: (params.align === undefined) ? 'left' : params.align,
field: (params.field === undefined) ? params.name : params.field,
subfield: (params.subfield === undefined) ? '' : params.subfield,
@@ -62,6 +65,7 @@ function AddCol(params: IColGridTable) {
action: (params.action === undefined) ? '' : params.action,
foredit: (params.foredit === undefined) ? true : params.foredit,
fieldtype: (params.fieldtype === undefined) ? costanti.FieldType.string : params.fieldtype,
field_outtype: (params.field_outtype === undefined) ? costanti.FieldType.string : params.field_outtype,
tipovisu: (params.tipovisu === undefined) ? costanti.TipoVisu.TESTO : params.tipovisu,
link: (params.link === undefined) ? '' : params.link,
askaction: (params.askaction === undefined) ? '' : params.askaction,
@@ -69,6 +73,7 @@ function AddCol(params: IColGridTable) {
jointable: (params.jointable === undefined) ? '' : params.jointable,
addall: (params.addall === undefined) ? false : params.addall,
filter: (params.filter === undefined) ? null : params.filter,
allowchar: (params.allowchar === undefined) ? null : params.allowchar,
showWhen: (params.showWhen === undefined) ? costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView : params.showWhen,
noshowlabel: (params.noshowlabel === undefined) ? false : params.noshowlabel,
notsave: (params.notsave === undefined) ? false : params.notsave,
@@ -328,6 +333,24 @@ export const colSectors = [
AddCol(DuplicateRec),
]
export const colCatGrps = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({
name: 'idCatGrp',
label_trans: 'sectors.name',
fieldtype: costanti.FieldType.select,
jointable: 'catgrps',
}),
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 }),
@@ -431,24 +454,36 @@ export const colmyUserPeople = [
export const colmyUserGroup = [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'groupname', label_trans: 'reg.groupname', required: true }),
AddCol({ name: 'title', label_trans: 'reg.name', required: true }),
AddCol({ name: 'groupname', label_trans: 'reg.groupname', required: true,
maxlength: 30,
allowchar: costanti.ALLOWCHAR_CODE,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
}),
AddCol({ name: 'title', label_trans: 'reg.name', required: true, noshowlabel: true, }),
AddCol({
name: 'idSector',
label_trans: 'sectors.name',
name: 'idCatGrp',
label_trans: 'catgrps.name',
fieldtype: costanti.FieldType.select,
required: true,
jointable: 'sectors',
jointable: 'catgrps',
visible: true,
icon: 'category',
noshowlabel: true,
}),
AddCol({ name: 'descr', label_trans: 'proj.longdescr', required: true, noshowlabel: true, }),
AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.multiselect, jointable: 'visibilGroup',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
}),
AddCol({ name: 'pwd', label_trans: 'groups.pwd', fieldtype: costanti.FieldType.crypted,
visibleif: costanti.BINARY_CHECK, visib_field: 'visibility', visib_value: costanti.RISERVATO_PASSWORD,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit,
}),
AddCol({ name: 'descr', label_trans: 'proj.longdescr', required: true }),
AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.select, jointable: 'visibilGroup', required: true }),
AddCol({
name: 'admins',
label_trans: 'groups.admins',
fieldtype: costanti.FieldType.multiselect,
jointable: 'friendsandme',
field_outtype: costanti.FieldType.object,
}),
AddCol({
name: 'photos',
@@ -472,6 +507,10 @@ export const colmyUserGroup = [
}),
AddCol({ name: 'date_created', label_trans: 'reg.date_created', fieldtype: costanti.FieldType.onlydate,
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView_OnlyifExist }),
AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
titlepopupedit: 'Dettagli', field_extra1: 'groupname', subfield_extra1: '' }),
AddCol(ModifRec),
AddCol(DeleteRec),
]
@@ -1928,6 +1967,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'descr',
},
{
value: 'catgrps',
label: 'Categorie',
columns: colCatGrps,
colkey: '_id',
collabel: 'descr',
},
{
value: 'levels',
label: 'Livello',

View File

@@ -1912,8 +1912,8 @@ export const tools = {
this.showNotif(q, msg, { color: 'negative', icon: 'notifications' }, 10000)
},
showNeutralNotif(q: any, msg: string) {
this.showNotif(q, msg, { color: 'info', icon: 'notifications' }, 10000)
showNeutralNotif(q: any, msg: string, time = 10000) {
this.showNotif(q, msg, { color: 'info', icon: 'notifications' }, time)
},
showNotif(q: any, msg: string, data ?: INotify | null, time?: number) {
@@ -4437,7 +4437,7 @@ export const tools = {
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
.then((res: any) => {
if (res) {
userStore.my.profile.groups = [...userStore.my.profile.groups, res]
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
tools.showPositiveNotif($q, t('db.addedgroup'))
}
})

View File

@@ -50,7 +50,7 @@ export const DefaultUser: IUserFields = {
myshares: [],
friends: [],
req_friends: [],
groups: [],
mygroups: [],
asked_friends: [],
asked_groups: [],
},
@@ -94,7 +94,7 @@ export const DefaultProfile: IUserProfile = {
myshares: [],
friends: [],
req_friends: [],
groups: [],
mygroups: [],
asked_friends: [],
asked_groups: [],
}
@@ -178,7 +178,7 @@ export const useUserStore = defineStore('UserStore', {
IsMyGroupByGroupname(groupname: string): boolean {
if (this.my.profile.friends)
return this.my.profile.groups.findIndex((rec) => rec.groupname === groupname) >= 0
return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0
else
return false
},
@@ -234,7 +234,7 @@ export const useUserStore = defineStore('UserStore', {
try {
//++Todo: Sistemare!
return costanti.DIR_UPLOAD + 'groups/' + group.groupname + '/' + group.photos[0].directory
return costanti.DIR_UPLOAD + 'mygroups/' + group.groupname + '/' + group.photos[0].imagefile
} catch (e) {
}
return 'images/noimg.png'
@@ -856,7 +856,7 @@ export const useUserStore = defineStore('UserStore', {
verified_by_aportador,
made_gift,
perm,
profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], groups: [], asked_groups: [] },
profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], mygroups: [], asked_groups: [] },
})
isLogged = true

View File

@@ -121,6 +121,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
subSkills: [],
statusSkills: [],
sectors: [],
catgrps: [],
cities: [],
}),
@@ -239,6 +240,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
return state.statusSkills
else if (table === 'sectors')
return state.sectors
else if (table === 'catgrps')
return state.catgrps
else {
return ris
}
@@ -1223,6 +1226,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.statusSkills = (res.data.statusSkills) ? [...res.data.statusSkills] : []
this.sectors = (res.data.sectors) ? [...res.data.sectors] : []
this.cities = (res.data.cities) ? [...res.data.cities] : []
this.catgrps = (res.data.catgrps) ? [...res.data.catgrps] : []
// console.log('res.data.cart', res.data.cart)
@@ -1390,6 +1394,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
myarr = myarr.filter(filter)
}
// console.log('myarr', table, myarr)
return myarr
},

View File

@@ -4,7 +4,7 @@
<div class="">
<q-avatar size="140px">
<q-img :src="getImgGrp()" :alt="username" img-class="imgprofile" height="140px" @click="showPic = true"/>
<q-img :src="getImgGrp()" :alt="mygrpname()" img-class="imgprofile" height="140px" @click="showPic = true"/>
</q-avatar>
</div>
@@ -36,6 +36,10 @@
<div v-if="mygrp.title">
<br>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="mygrp.note" v-html="mygrp.note">
</div>
</div>
</div>
<q-btn

View File

@@ -31,6 +31,46 @@ export default defineComponent({
filtercustom.value = []
arrfilterand.value = []
searchList.value = [
{
label: 'Categorie',
table: 'catgrps',
key: 'idCatGrp',
value: tools.getCookie(tools.COOK_SEARCH + 'catgrps', costanti.FILTER_TUTTI),
arrvalue: [],
type: costanti.FieldType.select,
filter: null,
addall: true,
useinput: false,
},
{
label: 'Provincia',
table: 'provinces',
key: 'idProvince',
type: costanti.FieldType.multiselect,
value: 0,
addall: true,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'provinces', [costanti.FILTER_TUTTI]),
filter: null,
useinput: true,
icon: 'flag',
},
{
label: 'Città',
table: 'cities',
key: 'idCity',
type: costanti.FieldType.multiselect_by_server,
value: 0,
addall: true,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]),
useinput: true,
filter: null,
// filter: getFilterCitiesByProvince,
// param1: shared_consts.PARAM_SHOW_PROVINCE,
tablesel: 'cities',
},
]
const filt_loaded = tools.getCookie(tools.COOK_SEARCH + tools.GROUP_SEARCH)
filter.value = filt_loaded ? filt_loaded : costanti.FIND_GROUP
}
@@ -61,10 +101,13 @@ export default defineComponent({
img: 1,
visibility: 1,
admins: 1,
idSector: 1,
idCatGrp: 1,
photos: 1,
idCity: 1,
note: 1,
comune: 1,
mycities: 1,
sector: 1,
}
},
lookup2: {
@@ -77,14 +120,17 @@ export default defineComponent({
title: 1,
descr: 1,
img: 1,
idSector: 1,
idCatGrp: 1,
visibility: 1,
admins: 1,
photos: 1,
idCity: 1,
note: 1,
comune: 1,
mycities: 1,
}
}
},
}
}

View File

@@ -1,7 +1,7 @@
<template>
<CMyPage
:title='myskill.subTitle' imgbackground="images/calendario_eventi.jpg"
sizes="max-height: 100px" styleadd="bottom: -16px !important;">
sizes="max-height: 120px" styleadd="bottom: -20px !important;">
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="!!myskill.note" v-html="myskill.note"></div>
@@ -22,6 +22,7 @@
</CSkill>
</div>
<!--
<div class="row justify-evenly q-mt-md">
<q-btn
type="a" rounded size="md"
@@ -32,6 +33,7 @@
</q-btn>
</div>
-->
</div>

View File

@@ -39,7 +39,7 @@
</div>
<div v-if="myuser.name">
<div class="col-12 text-h8 q-mt-sm">
<div class="col-12 text-h8 q-mt-sm" v-if="myuser.profile.qualifica">
<em><span class="qualifica">{{ myuser.profile.qualifica }}</span></em>
</div>
<div class="col-12 text-h8 q-mt-sm">