- Aggiunto Filtri
- Finder
This commit is contained in:
@@ -27,7 +27,6 @@ export const shared_consts = {
|
||||
FILTER_USER_CODICE_AUTH_TELEGRAM: 64,
|
||||
FILTER_USER_NO_EMAIL_VERIFICATA: 128,
|
||||
FILTER_USER_NO_DREAM: 256,
|
||||
FILTER_EXTRALIST_DELETED: 512,
|
||||
FILTER_USER_TELEGRAM_BLOCKED: 1024,
|
||||
FILTER_ATTIVI: 2048,
|
||||
FILTER_NASCOSTI: 4096,
|
||||
@@ -40,6 +39,8 @@ export const shared_consts = {
|
||||
FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288,
|
||||
FILTER_MEMBERSHIP_CARD_OK: 1048576,
|
||||
|
||||
FILTER_MYSKILL_SKILL: 1,
|
||||
|
||||
REPORT_FILT_RESP: 1,
|
||||
REPORT_FILT_ATTIVITA: 2,
|
||||
|
||||
|
||||
29
src/components/CFinder/CFinder.scss
Executable file
29
src/components/CFinder/CFinder.scss
Executable file
@@ -0,0 +1,29 @@
|
||||
|
||||
.cltitlebg{
|
||||
|
||||
}
|
||||
|
||||
.titletext {
|
||||
color: white;
|
||||
font-size: 3rem;
|
||||
font-weight: 500;
|
||||
line-height: 3rem;
|
||||
text-shadow: .25rem .25rem .5rem black;
|
||||
letter-spacing: .00937em;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
@media (max-width: 718px) {
|
||||
// PER VERSIONE MOBILE
|
||||
.titletext {
|
||||
color: white;
|
||||
font-size: 2rem;
|
||||
font-weight: 500;
|
||||
line-height: 2rem;
|
||||
text-shadow: .25rem .25rem .5rem black;
|
||||
}
|
||||
}
|
||||
|
||||
.q-img__content > div{
|
||||
background: rgba(0,0,0,0.17) !important;
|
||||
}
|
||||
148
src/components/CFinder/CFinder.ts
Executable file
148
src/components/CFinder/CFinder.ts
Executable file
@@ -0,0 +1,148 @@
|
||||
import {
|
||||
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { costanti } from '@costanti'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { colmySkills } from '@store/Modules/fieldsTable'
|
||||
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||
import { IMySkill, ISearchList, ISkill } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CFinder',
|
||||
props: {
|
||||
defaultnewrec: {
|
||||
type: Function,
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CMyFieldDb, CGridTableRec,
|
||||
},
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
const mytable = 'users'
|
||||
const globalStore = useGlobalStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const arrfilterand: any = ref([])
|
||||
const filtercustom: any = ref([])
|
||||
const searchList = ref(<ISearchList[]>[])
|
||||
|
||||
function mounted() {
|
||||
/*arrfilterand.value = [
|
||||
{
|
||||
label: 'Competenze',
|
||||
value: shared_consts.FILTER_MYSKILL_SKILL
|
||||
},
|
||||
|
||||
]*/
|
||||
|
||||
searchList.value = [
|
||||
{
|
||||
label: 'Settore',
|
||||
table: 'sectors',
|
||||
key: 'idSector',
|
||||
value: costanti.FILTER_TUTTI,
|
||||
type: costanti.FieldType.select,
|
||||
},
|
||||
{
|
||||
label: 'Competenza',
|
||||
table: 'skills',
|
||||
key: 'idSkill',
|
||||
value: costanti.FILTER_TUTTI,
|
||||
type: costanti.FieldType.select,
|
||||
},
|
||||
{
|
||||
label: 'Citta',
|
||||
table: 'cities',
|
||||
key: 'idCity',
|
||||
value: costanti.FILTER_TUTTI,
|
||||
type: costanti.FieldType.multiselect,
|
||||
},
|
||||
{
|
||||
label: 'Livello',
|
||||
table: 'levels',
|
||||
key: 'numLevel',
|
||||
value: costanti.FILTER_TUTTI,
|
||||
type: costanti.FieldType.select,
|
||||
},
|
||||
{
|
||||
label: 'Stato',
|
||||
table: 'statusSkills',
|
||||
key: 'idStatusSkill',
|
||||
value: costanti.FILTER_TUTTI,
|
||||
type: costanti.FieldType.multiselect,
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
filtercustom.value = []
|
||||
}
|
||||
|
||||
async function createNewRecordInUserTable() {
|
||||
console.log('createNewRecordInUserTable')
|
||||
|
||||
let mydata = {
|
||||
table: mytable,
|
||||
data: {
|
||||
userId: userStore.my._id,
|
||||
data: {},
|
||||
field: 'myskills'
|
||||
}
|
||||
};
|
||||
|
||||
if (props.defaultnewrec) {
|
||||
|
||||
mydata.data.data = props.defaultnewrec
|
||||
}
|
||||
|
||||
console.log('mydata', mydata)
|
||||
const data = await globalStore.saveSubRec(mydata)
|
||||
}
|
||||
|
||||
function getdefaultnewrec(): any {
|
||||
return {
|
||||
_id: 0,
|
||||
idSkill: 0,
|
||||
idStatusSkill: [],
|
||||
idCity: [],
|
||||
NumLevel: 0,
|
||||
photos: [],
|
||||
note: '',
|
||||
subTitle: '',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function extraparams() {
|
||||
return {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
idSkill: 1, idStatusSkill: 1, idCity: 1, numLevel: 1, photos: 1, note: 1, subTitle: 1, date_created:1, date_updated: 1,
|
||||
userId: 1, username: 1, name: 1, surname: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
colmySkills,
|
||||
getdefaultnewrec,
|
||||
extraparams,
|
||||
arrfilterand,
|
||||
filtercustom,
|
||||
searchList,
|
||||
}
|
||||
},
|
||||
})
|
||||
32
src/components/CFinder/CFinder.vue
Executable file
32
src/components/CFinder/CFinder.vue
Executable file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<CGridTableRec
|
||||
prop_mytable="myskills"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmySkills"
|
||||
prop_colkey="idSkill"
|
||||
col_title="subTitle"
|
||||
:vertical="true"
|
||||
nodataLabel="Nessuna Competenza inserita"
|
||||
:prop_search="true"
|
||||
:finder="true"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
:prop_searchList="searchList"
|
||||
:defaultnewrec="getdefaultnewrec"
|
||||
:extraparams="extraparams()">
|
||||
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CFinder.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CFinder.scss';
|
||||
</style>
|
||||
1
src/components/CFinder/index.ts
Executable file
1
src/components/CFinder/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CFinder } from './CFinder.vue'
|
||||
@@ -71,6 +71,7 @@ export default defineComponent({
|
||||
gallerylist.value = [
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function showandsave(value: any) {
|
||||
|
||||
@@ -3,10 +3,13 @@ import { useI18n } from '@src/boot/i18n'
|
||||
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
|
||||
import {
|
||||
IColGridTable,
|
||||
IFilter,
|
||||
ITableRec,
|
||||
ISearchList,
|
||||
IPagination,
|
||||
IParamDialog,
|
||||
IEvents,
|
||||
@@ -16,6 +19,8 @@ import {
|
||||
import { lists } from '../../store/Modules/lists'
|
||||
import { IParamsQuery } from '../../model/GlobalStore'
|
||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||
import { CMyFieldDb } from '../CMyFieldDb'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
@@ -53,6 +58,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
butt_modif_new: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
finder: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
vertical: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -83,6 +98,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
prop_searchList: {
|
||||
type: Object as PropType<ISearchList[]>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
arrfilters: {
|
||||
type: Object as PropType<IFilter[]>,
|
||||
required: false,
|
||||
@@ -95,6 +115,13 @@ export default defineComponent({
|
||||
return []
|
||||
}
|
||||
},
|
||||
filtercustom: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
extraparams: {
|
||||
required: false,
|
||||
default: {},
|
||||
@@ -116,7 +143,7 @@ export default defineComponent({
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: { CMyPopupEdit, CTitleBanner },
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -145,6 +172,7 @@ export default defineComponent({
|
||||
|
||||
const serverData: any = ref([])
|
||||
const spinner_visible = ref(false)
|
||||
const searchList = toRef(props, 'prop_searchList')
|
||||
|
||||
let idsel = ''
|
||||
let colsel = ref(<IColGridTable | null>{ name: '', field: '' })
|
||||
@@ -153,6 +181,7 @@ export default defineComponent({
|
||||
let separator: 'horizontal'
|
||||
const myfilter = ref('')
|
||||
const myfilterand: any = ref([])
|
||||
const myfiltercustom: any = ref([])
|
||||
let rowsel: any = {}
|
||||
let dark = true
|
||||
const canEdit = ref(false)
|
||||
@@ -169,6 +198,15 @@ export default defineComponent({
|
||||
|
||||
const mycodeid = toRef(props, 'prop_codeId')
|
||||
|
||||
watch(searchList.value, (to: any, from: any) => {
|
||||
refresh()
|
||||
})
|
||||
|
||||
function searchval(newval: any) {
|
||||
console.log('searchval')
|
||||
refresh()
|
||||
}
|
||||
|
||||
// emulate 'SELECT count(*) FROM ...WHERE...'
|
||||
function getRowsNumberCount(myfilter?: any) {
|
||||
|
||||
@@ -188,7 +226,7 @@ export default defineComponent({
|
||||
|
||||
// emulate ajax call
|
||||
// SELECT * FROM ... WHERE...LIMIT...
|
||||
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) {
|
||||
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, filtercustom: any, sortBy: any, descending: any) {
|
||||
|
||||
let myobj: any = {}
|
||||
if (sortBy) {
|
||||
@@ -202,12 +240,29 @@ export default defineComponent({
|
||||
|
||||
// console.log('sortBy', sortBy)
|
||||
|
||||
let filtersearch: ISearchList[] = []
|
||||
|
||||
if (searchList.value) {
|
||||
searchList.value.forEach((item: ISearchList) => {
|
||||
if (item.value > 0) {
|
||||
let myarr: ISearchList
|
||||
let objitem: any = {}
|
||||
objitem[item.key] = item.value
|
||||
filtersearch.push(objitem)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
let params: IParamsQuery = {
|
||||
table: mytable.value,
|
||||
startRow,
|
||||
endRow,
|
||||
filter: param_myfilter,
|
||||
filterand: param_myfilterand,
|
||||
// @ts-ignore
|
||||
filtersearch: filtersearch,
|
||||
filtercustom,
|
||||
sortBy: myobj,
|
||||
descending,
|
||||
userId: userStore.my._id,
|
||||
@@ -217,6 +272,7 @@ export default defineComponent({
|
||||
params.codeId = mycodeid.value
|
||||
|
||||
// console.log('params', params)
|
||||
console.log('props.extraparams', props.extraparams)
|
||||
|
||||
params = { ...params, ...props.extraparams }
|
||||
|
||||
@@ -243,6 +299,7 @@ export default defineComponent({
|
||||
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
|
||||
const myfilternow = myfilter.value
|
||||
const myfilterandnow = myfilterand.value
|
||||
const myfiltercustomnow = myfiltercustom.value
|
||||
|
||||
savefilter()
|
||||
|
||||
@@ -269,7 +326,7 @@ export default defineComponent({
|
||||
serverData.value = []
|
||||
|
||||
// fetch data from "server"
|
||||
return fetchFromServer(startRow, endRow, myfilternow, myfilterandnow, sortBy, descending).then((ris: any) => {
|
||||
return fetchFromServer(startRow, endRow, myfilternow, myfilterandnow, myfiltercustomnow, sortBy, descending).then((ris: any) => {
|
||||
|
||||
pagination.value.rowsNumber = getRowsNumberCount(myfilter)
|
||||
|
||||
@@ -340,6 +397,10 @@ export default defineComponent({
|
||||
refresh()
|
||||
})
|
||||
|
||||
watch(() => myfiltercustom.value, (newval, oldval) => {
|
||||
refresh()
|
||||
})
|
||||
|
||||
function isTutor() {
|
||||
return userStore.isTutor
|
||||
}
|
||||
@@ -542,7 +603,6 @@ export default defineComponent({
|
||||
mycolumns.value = props.prop_mycolumns
|
||||
colkey.value = props.prop_colkey
|
||||
pagination.value = props.prop_pagination
|
||||
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
@@ -553,6 +613,7 @@ export default defineComponent({
|
||||
tablesel.value = tools.getCookie('tablesel', tablesel.value)
|
||||
}
|
||||
myfilterand.value = props.filterdef
|
||||
myfiltercustom.value = props.filtercustom
|
||||
// console.log('tablesel', tablesel)
|
||||
|
||||
if (tablesel.value === '') {
|
||||
@@ -867,6 +928,8 @@ export default defineComponent({
|
||||
|
||||
mydata.data = recModif.value
|
||||
|
||||
const oldrec = serverData.value.find((rec: IMySkill) => rec._id === recModif.value._id)
|
||||
|
||||
const data = await globalStore.saveTable(mydata)
|
||||
.then((ris) => {
|
||||
if (ris) {
|
||||
@@ -874,6 +937,11 @@ export default defineComponent({
|
||||
editRecordBool.value = false
|
||||
const indrec = serverData.value.findIndex((rec: IMySkill) => rec._id === ris._id)
|
||||
console.log('indrec', indrec, serverData.value[indrec])
|
||||
mycolumns.value.forEach((col:IColGridTable) => {
|
||||
if (!col.foredit) {
|
||||
ris[col.name] = oldrec[col.name]
|
||||
}
|
||||
})
|
||||
if (indrec >= 0)
|
||||
serverData.value[indrec] = ris
|
||||
}
|
||||
@@ -954,7 +1022,13 @@ export default defineComponent({
|
||||
spinner_visible,
|
||||
tablesel,
|
||||
myfilterand,
|
||||
myfiltercustom,
|
||||
tools,
|
||||
costanti,
|
||||
fieldsTable,
|
||||
globalStore,
|
||||
searchList,
|
||||
searchval,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<div class="q-gutter-md q-ma-xs row">
|
||||
<div class="q-table__title" style="min-width: 150px;">{{ mytitle }}</div>
|
||||
<q-space></q-space>
|
||||
<div v-if="butt_modif_new">
|
||||
<q-btn
|
||||
v-if="mytable" rounded dense size="sm" flat :color="canEdit ? 'positive' : 'light-gray'"
|
||||
:disable="disabilita()"
|
||||
@@ -58,6 +59,7 @@
|
||||
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<q-inner-loading :showing="spinner_visible">
|
||||
<q-spinner-tail size="2em" color="primary"/>
|
||||
</q-inner-loading>
|
||||
@@ -126,6 +128,55 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-slot:top-left v-if="searchList">
|
||||
<div class="row">
|
||||
<div v-for="(item, index) in searchList" :key="index">
|
||||
<CMySelect
|
||||
v-if="item.type === costanti.FieldType.select"
|
||||
:label="item.label"
|
||||
v-model:value="item.value"
|
||||
@update:value="searchval"
|
||||
:addall="true"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
:options="globalStore.getTableJoinByName(item.table, true)"
|
||||
:useinput="false">
|
||||
</CMySelect>
|
||||
|
||||
<q-select
|
||||
v-if="item.type === costanti.FieldType.multiselect"
|
||||
v-model="item.value"
|
||||
rounded
|
||||
outlined
|
||||
multiple
|
||||
dense
|
||||
options-dense
|
||||
:display-value="fieldsTable.getTitleByTable(item.table)"
|
||||
emit-value
|
||||
map-options
|
||||
:options="globalStore.getTableJoinByName(item.table)"
|
||||
style="min-width: 150px"
|
||||
:option-value="fieldsTable.getKeyByTable(item.table)"
|
||||
@update:model-value="searchval">
|
||||
|
||||
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
|
||||
<q-item v-bind="itemProps">
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>{{ opt[fieldsTable.getLabelByTable(item.table)] }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-toggle :model-value="selected" @update:value="toggleOption(opt)"/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="trclass">
|
||||
<q-td auto-width class="tdclass">
|
||||
@@ -137,7 +188,7 @@
|
||||
v-if="colVisib.includes(col.field + col.subfield)" class="tdclass">
|
||||
<div :class="getclrow(props.row)">
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
:table="mytable"
|
||||
:canEdit="canEdit"
|
||||
:disable="disabilita()"
|
||||
:mycol="col"
|
||||
@@ -202,7 +253,7 @@
|
||||
<div :class="getclrow(props.row)">
|
||||
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
:table="mytable"
|
||||
:canEdit="canEdit"
|
||||
:disable="disabilita()"
|
||||
:mycol="col"
|
||||
@@ -258,7 +309,7 @@
|
||||
@click="colclicksel = mycol">
|
||||
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
:table="mytable"
|
||||
:canEdit="true"
|
||||
:disable="disabilita()"
|
||||
view="field"
|
||||
@@ -289,11 +340,11 @@
|
||||
<div
|
||||
v-for="col in mycolumns" :key="col.name" class="newrec_fields">
|
||||
<div
|
||||
v-if="colVisib.includes(col.field + col.subfield)">
|
||||
v-if="colVisib.includes(col.field + col.subfield) && col.foredit">
|
||||
<div class="">
|
||||
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
:table="mytable"
|
||||
:canEdit="true"
|
||||
:mycol="col"
|
||||
v-model:row="newRecord"
|
||||
@@ -329,10 +380,10 @@
|
||||
<div
|
||||
v-for="col in mycolumns" :key="col.name">
|
||||
<div
|
||||
v-if="colVisib.includes(col.field + col.subfield)">
|
||||
v-if="colVisib.includes(col.field + col.subfield) && col.foredit">
|
||||
<div>
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
:table="mytable"
|
||||
:canEdit="true"
|
||||
:mycol="col"
|
||||
:isInModif="true"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:filterdef="myfilterdef"
|
||||
:prop_codeId="todoId"
|
||||
:defaultnewrec="getdefaultnewrec"
|
||||
:extraparams="extraparams"
|
||||
:extraparams="extraparams()"
|
||||
labeladd="Aggiungi Ora">
|
||||
|
||||
</CGridTableRec>
|
||||
|
||||
@@ -509,14 +509,18 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
function getDirectoryGall() {
|
||||
let ris = ''
|
||||
if (fieldsTable.tableForUsers.includes(props.table)) {
|
||||
return 'profile/' + userStore.my.username + '/' + props.table
|
||||
console.log('1')
|
||||
ris = 'profile/' + myrow.value['username'] + '/' + props.table
|
||||
}else if (props.table === 'users') {
|
||||
return 'profile/' + userStore.my.username
|
||||
console.log('2')
|
||||
ris = 'profile/' + userStore.my.username
|
||||
} else {
|
||||
return props.table
|
||||
console.log('3')
|
||||
ris = props.table
|
||||
}
|
||||
|
||||
return ris
|
||||
}
|
||||
|
||||
function uploaded(info: any) {
|
||||
|
||||
@@ -79,7 +79,6 @@
|
||||
:directory="getDirectoryGall()"
|
||||
:imgGall="myvalue" :edit="isviewfield()"
|
||||
@showandsave="Savedb">
|
||||
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image">
|
||||
@@ -93,7 +92,6 @@
|
||||
:single="isFieldDb()"
|
||||
@update:imgGall="changevalRec"
|
||||
@showandsave="Savedb">
|
||||
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { defineComponent, onMounted, ref } from 'vue'
|
||||
import { computed, defineComponent, onMounted, ref } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelect',
|
||||
@@ -32,6 +33,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
addall: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -60,6 +66,21 @@ export default defineComponent({
|
||||
|
||||
const myvalue = ref(<string | number>'')
|
||||
|
||||
const valori = computed(() => {
|
||||
let myarr = props.options
|
||||
if (props.addall) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '(Tutti)'
|
||||
myobj[props.optval] = costanti.FILTER_TUTTI
|
||||
}
|
||||
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
|
||||
return myarr
|
||||
})
|
||||
|
||||
function changeval(newval: any) {
|
||||
console.log('changeval', newval)
|
||||
myvalue.value = newval
|
||||
@@ -101,6 +122,7 @@ export default defineComponent({
|
||||
return {
|
||||
changeval,
|
||||
myvalue,
|
||||
valori,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
input-debounce="0"
|
||||
@new-value="newvaluefunc"
|
||||
new-value-mode="add-unique"
|
||||
:options="options"
|
||||
:options="valori"
|
||||
:option-value="optval"
|
||||
:option-label="optlab"
|
||||
@update:model-value="changeval"
|
||||
@@ -27,7 +27,7 @@
|
||||
:dense="dense"
|
||||
:input-class="myclass"
|
||||
:model-value="myvalue"
|
||||
:options="options"
|
||||
:options="valori"
|
||||
:option-value="optval"
|
||||
:option-label="optlab"
|
||||
@update:model-value="changeval"
|
||||
|
||||
@@ -65,6 +65,8 @@ export default defineComponent({
|
||||
endRow: 10000,
|
||||
filter: '',
|
||||
filterand: '',
|
||||
filtersearch: '',
|
||||
filtercustom: '',
|
||||
sortBy: myobj,
|
||||
descending,
|
||||
userId: userStore.my._id
|
||||
|
||||
@@ -62,11 +62,26 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
|
||||
function extraparams() {
|
||||
return {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
idSkill: 1, idStatusSkill: 1, idCity: 1, numLevel: 1, photos: 1, note: 1, subTitle: 1, date_created:1, date_updated: 1,
|
||||
userId: 1, username: 1, name: 1, surname: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
tools,
|
||||
costanti,
|
||||
colmySkills,
|
||||
getdefaultnewrec,
|
||||
extraparams,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
nodataLabel="Nessuna Competenza inserita"
|
||||
:prop_search="false"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
||||
:defaultnewrec="getdefaultnewrec">
|
||||
:defaultnewrec="getdefaultnewrec"
|
||||
:extraparams="extraparams()">
|
||||
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
|
||||
@@ -432,7 +432,9 @@ export interface IParamsQuery {
|
||||
endRow: number
|
||||
filter: string
|
||||
filterand: string
|
||||
sortBy: any
|
||||
filtersearch: string
|
||||
filtercustom: string
|
||||
sortBy: string
|
||||
descending: number
|
||||
userId: string
|
||||
codeId?: string
|
||||
@@ -479,6 +481,14 @@ export interface ITableRec {
|
||||
noshow: boolean
|
||||
}
|
||||
|
||||
export interface ISearchList {
|
||||
label: string
|
||||
table: string
|
||||
key: string
|
||||
value: any
|
||||
type: number
|
||||
}
|
||||
|
||||
export interface IFilter {
|
||||
label: string
|
||||
value: string
|
||||
|
||||
@@ -5,13 +5,14 @@ import {
|
||||
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { CSkill } from '@/components/CSkill'
|
||||
import { CFinder } from '@/components/CFinder'
|
||||
import { CChartMap } from '@src/components/CChartMap'
|
||||
import { CMapsEsempio } from '@src/components/CMapsEsempio'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Home',
|
||||
components: { CSkill, CChartMap, CMapsEsempio },
|
||||
components: { CSkill, CChartMap, CMapsEsempio, CFinder },
|
||||
setup() {
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<q-page class="">
|
||||
<h1>Inizio:</h1>
|
||||
|
||||
<!--<CChartMap
|
||||
title="Mappa"
|
||||
@@ -12,6 +11,8 @@
|
||||
|
||||
<!--<CMapsEsempio></CMapsEsempio>-->
|
||||
|
||||
<CFinder />
|
||||
|
||||
</q-page>
|
||||
|
||||
</template>
|
||||
|
||||
@@ -64,6 +64,13 @@ export default defineComponent({
|
||||
}
|
||||
]
|
||||
|
||||
} else if (tools.appid() === tools.IDAPP_FREEPLANET) {
|
||||
arrfilterand.value = [
|
||||
{
|
||||
label: 'Attivi',
|
||||
value: shared_consts.FILTER_ATTIVI
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +405,8 @@ const msg_it = {
|
||||
elimina: 'Elimina',
|
||||
deleted: 'Nascosto',
|
||||
sospeso: 'Sospeso',
|
||||
username: 'Username (Pseudonimo)',
|
||||
username: 'Username',
|
||||
username_pseudonimo: 'Username (Pseudonimo)',
|
||||
username_short: 'Username',
|
||||
name: 'Nome',
|
||||
surname: 'Cognome',
|
||||
|
||||
@@ -8,6 +8,8 @@ export const costanti = {
|
||||
CONFIG_ID_STATE_CONN: '2',
|
||||
CONFIG_ID_SHOW_TYPE_TODOS: '3',
|
||||
|
||||
FILTER_TUTTI: -100,
|
||||
|
||||
FuncDialog: {
|
||||
CANCEL_BOOKING: 1,
|
||||
},
|
||||
|
||||
@@ -339,9 +339,12 @@ export const colSkills = [
|
||||
]
|
||||
|
||||
export const colmySkills = [
|
||||
//AddCol({
|
||||
// name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
//}),
|
||||
AddCol({
|
||||
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
}),
|
||||
//AddCol({ name: 'name', label_trans: 'reg.name', fieldtype: costanti.FieldType.string }),
|
||||
//AddCol({ name: 'surname', label_trans: 'reg.surname', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'username', label_trans: 'reg.username', foredit: false }),
|
||||
AddCol({
|
||||
name: 'idSkill',
|
||||
label_trans: 'skill.name',
|
||||
|
||||
@@ -62,6 +62,7 @@ export const tools = {
|
||||
IDAPP_AYNI: '7',
|
||||
IDAPP_SIP: '9',
|
||||
IDAPP_CNM: '10',
|
||||
IDAPP_FREEPLANET: '1',
|
||||
|
||||
TipoMsg: {
|
||||
SEND_LINK_CHAT_DONATORI: 1,
|
||||
|
||||
@@ -1250,12 +1250,24 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return ''
|
||||
},
|
||||
|
||||
getTableJoinByName(table: string) {
|
||||
getTableJoinByName(table: string, addall?: boolean) {
|
||||
if (table === 'permissions') return [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Tutor, shared_consts.Permissions.Editor, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department]
|
||||
if (table === 'accepted') return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
|
||||
if (table === 'fieldstype') return costanti.FieldTypeArr
|
||||
if (table === 'metodo_pagamento') return tools.SelectMetodiPagamento
|
||||
return this.getListByTable(table)
|
||||
|
||||
let myarr = this.getListByTable(table)
|
||||
|
||||
// if (addall)
|
||||
// myarr = [costanti.FILTER_TUTTI, ...myarr]
|
||||
|
||||
if (!addall) {
|
||||
if (table === 'skills') {
|
||||
myarr = myarr.filter((rec: any) => rec._id > 0)
|
||||
}
|
||||
}
|
||||
|
||||
return myarr
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user