PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { defineComponent, PropType, ref, watch, toRef, onMounted, onBeforeUnmount, toRefs, computed, inject, onUnmounted, nextTick } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, ref, watch, toRef, onMounted, onBeforeUnmount, toRefs, computed, inject, onUnmounted, nextTick } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
import {
|
||||
import type {
|
||||
IColGridTable,
|
||||
IFilter,
|
||||
ITableRec,
|
||||
@@ -15,12 +16,14 @@ import {
|
||||
IPagination,
|
||||
IParamDialog,
|
||||
IMySkill,
|
||||
ICoordLatLng,
|
||||
ICoordGPS,
|
||||
IOptGrid
|
||||
} from 'model';
|
||||
import {
|
||||
ICoordLatLng,
|
||||
ICoordGPS
|
||||
} from 'model'
|
||||
import { lists } from '@store/Modules/lists'
|
||||
import { IParamsQuery } from 'model'
|
||||
import type { IParamsQuery } from 'model'
|
||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||
import { CMyFriends } from '../CMyFriends'
|
||||
import { CNotifSettings } from '../CNotifSettings'
|
||||
@@ -39,13 +42,13 @@ import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar, exportFile } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import translate from '@/globalroutines/util'
|
||||
import translate from '@src/globalroutines/util'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { CMyCardPopup } from '@/components/CMyCardPopup'
|
||||
import { CMyCardService } from '@/components/CMyCardService'
|
||||
import { CSingleMovement } from '@/components/CSingleMovement'
|
||||
import { CMyCardGrpPopup } from '@/components/CMyCardGrpPopup'
|
||||
import { CMyCardCircuitPopup } from '@/components/CMyCardCircuitPopup'
|
||||
import { CMyCardPopup } from '@src/components/CMyCardPopup'
|
||||
import { CMyCardService } from '@src/components/CMyCardService'
|
||||
import { CSingleMovement } from '@src/components/CSingleMovement'
|
||||
import { CMyCardGrpPopup } from '@src/components/CMyCardGrpPopup'
|
||||
import { CMyCardCircuitPopup } from '@src/components/CMyCardCircuitPopup'
|
||||
import { onBeforeRouteLeave, onBeforeRouteUpdate, useRouter } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
|
||||
@@ -65,7 +68,8 @@ export default defineComponent({
|
||||
},
|
||||
prop_mytitlenew: {
|
||||
type: String,
|
||||
required: true,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
subtitle: {
|
||||
type: String,
|
||||
@@ -212,7 +216,9 @@ export default defineComponent({
|
||||
opt: {
|
||||
type: Object as PropType<IOptGrid>,
|
||||
required: false,
|
||||
default: {},
|
||||
default: () => {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
filterdef: {
|
||||
type: Array,
|
||||
@@ -251,6 +257,7 @@ export default defineComponent({
|
||||
default: 0,
|
||||
},
|
||||
heightcarousel: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
@@ -276,7 +283,9 @@ export default defineComponent({
|
||||
defaultnewrec: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: {},
|
||||
default: () => {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
col_title: {
|
||||
type: String,
|
||||
@@ -416,7 +425,7 @@ export default defineComponent({
|
||||
const editOn = computed({
|
||||
get: () => globalStore.editOn,
|
||||
set: val => {
|
||||
tools.updateEditOn(val!)
|
||||
tools.updateEditOn(val)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -789,19 +798,19 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getObjSort(sortBy: any, descending: any) {
|
||||
let myobj: any = {}
|
||||
const myobj: any = {}
|
||||
if (tools.isObject(sortBy)) {
|
||||
// console.log('sortBy', sortBy)
|
||||
return sortBy
|
||||
} else if (sortBy) {
|
||||
sortBy = sortBy + ''
|
||||
// descending = descending + ''
|
||||
let arrsort = (sortBy && sortBy.indexOf(',') > 0) ? sortBy.split(',') : [];
|
||||
let arrdescending = (descending && descending.length > 1 && descending.indexOf(',') > 0) ? descending.split(',') : [];
|
||||
const arrsort = (sortBy && sortBy.indexOf(',') > 0) ? sortBy.split(',') : [];
|
||||
const arrdescending = (descending && descending.length > 1 && descending.indexOf(',') > 0) ? descending.split(',') : [];
|
||||
if (arrsort.length > 0) {
|
||||
for (let i = 0; i < arrsort.length; i++) {
|
||||
let field = arrsort[i].trim()
|
||||
let risdesc = (tools.isArray(arrdescending) && (arrdescending.length > i)) ? parseInt(arrdescending[i].trim()) : 1;
|
||||
const field = arrsort[i].trim()
|
||||
const risdesc = (tools.isArray(arrdescending) && (arrdescending.length > i)) ? parseInt(arrdescending[i].trim()) : 1;
|
||||
myobj[field] = getOrderByField(field, risdesc)
|
||||
}
|
||||
} else {
|
||||
@@ -931,7 +940,7 @@ export default defineComponent({
|
||||
let nomecircuito = item.value
|
||||
if (tools.isObject(item.value))
|
||||
nomecircuito = item.value.name
|
||||
|
||||
|
||||
filtersearch3and.push({ "profile.mycircuits.circuitname": nomecircuito })
|
||||
}
|
||||
}
|
||||
@@ -961,7 +970,7 @@ export default defineComponent({
|
||||
});
|
||||
} else if (myitemsingle === shared_consts.FILTER_USER_ONLINE_6_MESI) {
|
||||
const numgiorni_attivi = 30 * 6
|
||||
let daytocheck = new Date();
|
||||
const daytocheck = new Date();
|
||||
daytocheck.setDate(daytocheck.getDate() - numgiorni_attivi);
|
||||
daytocheck.setHours(0, 0, 0, 0)
|
||||
|
||||
@@ -1012,7 +1021,7 @@ export default defineComponent({
|
||||
|
||||
} else if (item.table === 'cities') {
|
||||
|
||||
if (item.value && item.value.hasOwnProperty('_id')) {
|
||||
if (tools.existProp(item.value, '_id')) {
|
||||
const myfield = tools.getFieldSearchByTable(mytable.value, item.table, 'idCity')
|
||||
if (myfield) {
|
||||
obj[myfield] = item.value._id
|
||||
@@ -1042,7 +1051,7 @@ export default defineComponent({
|
||||
objitem[item.key] = item.value
|
||||
filter_gte.push(objitem)
|
||||
|
||||
|
||||
|
||||
} else if (item.table === 'lista_editori') {
|
||||
|
||||
if (item.value !== costanti.FILTER_TUTTI) {
|
||||
@@ -1473,7 +1482,7 @@ export default defineComponent({
|
||||
tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + toolsext.TABPROVINCE, filtroProv.value)
|
||||
}
|
||||
}
|
||||
/*const filtroCircuito = searchList.value.find((myrec) => myrec.table === 'circuits')
|
||||
/*const filtroCircuito = searchList.value.find((myrec) => myrec.table === 'circuits')
|
||||
if (filtroCircuito && filtroCircuito.value !== costanti.FILTER_TUTTI) {
|
||||
const filtroProv = searchList.value.find((myrec) => myrec.table === toolsext.TABPROVINCE) // check if exist
|
||||
if (filtroProv && filtroRegioni) {
|
||||
@@ -1563,14 +1572,14 @@ export default defineComponent({
|
||||
if (col.jointable === toolsext.TABSECTORS) {
|
||||
// Sbianca la select della Categoria
|
||||
|
||||
if (item && item.hasOwnProperty('idSkill')) {
|
||||
if (tools.existProp(item, 'idSkill')) {
|
||||
item.idSkill = costanti.FILTER_NESSUNO
|
||||
newRecord.value.idSkill = item.idSkill
|
||||
}
|
||||
} else if (col.jointable === toolsext.TABSECTORGOODS) {
|
||||
// Sbianca la select della Categoria Beni
|
||||
|
||||
if (item && item.hasOwnProperty('idGood')) {
|
||||
if (tools.existProp(item, 'idGood')) {
|
||||
item.idGood = costanti.FILTER_NESSUNO
|
||||
newRecord.value.idGood = item.idGood
|
||||
console.log('newRecord', newRecord)
|
||||
@@ -1742,7 +1751,7 @@ export default defineComponent({
|
||||
newRecord.value = {}
|
||||
}
|
||||
newRecord.value.userId = userStore.my._id
|
||||
newRecord.value.idapp = process.env.APP_ID
|
||||
newRecord.value.idapp = tools.getEnv('VITE_APP_ID')
|
||||
// globalStore.saveTable(mydata).then(ris => console.log('RISULT', ris))
|
||||
newRecordBool.value = true
|
||||
|
||||
@@ -1855,7 +1864,7 @@ export default defineComponent({
|
||||
// console.log('props.filtercustom', props.filtercustom)
|
||||
|
||||
|
||||
if (!!props.tablesList) {
|
||||
if (props.tablesList) {
|
||||
canEdit.value = tools.getCookie(tools.CAN_EDIT, canEdit) === 'true'
|
||||
tablesel.value = tools.getCookie('tablesel', tablesel.value)
|
||||
}
|
||||
@@ -1865,7 +1874,7 @@ export default defineComponent({
|
||||
// console.log('tablesel', tablesel)
|
||||
|
||||
if (tablesel.value === '') {
|
||||
if (!!props.tablesList)
|
||||
if (props.tablesList)
|
||||
tablesel.value = props.tablesList[0].value
|
||||
else
|
||||
tablesel.value = mytable.value
|
||||
@@ -1874,17 +1883,17 @@ export default defineComponent({
|
||||
if (!shared_consts.TABLES_ORDER_DATE_UPDATED.includes(tablesel.value) &&
|
||||
!shared_consts.TABLES_ORDER_DESCR.includes(tablesel.value)) {
|
||||
// console.log('get cookie)')
|
||||
let v1 = tools.getCookie('s_ordinamnew_' + tablesel.value, null)
|
||||
const v1 = tools.getCookie('s_ordinamnew_' + tablesel.value, null)
|
||||
if (v1)
|
||||
ordinam.value = v1
|
||||
let v2 = tools.getCookie('s_ordinamnew_des_' + tablesel.value, null)
|
||||
const v2 = tools.getCookie('s_ordinamnew_des_' + tablesel.value, null)
|
||||
if (v2)
|
||||
ordinam_desc.value = v2
|
||||
}
|
||||
|
||||
// console.log('2) tablesel', tablesel.value)
|
||||
|
||||
changeTable(tablesel.value, true)
|
||||
changeTable(tablesel.value)
|
||||
|
||||
nextTick(() => {
|
||||
checkScrollPosition()
|
||||
@@ -2027,7 +2036,7 @@ export default defineComponent({
|
||||
|
||||
function changeCol(newval: any) {
|
||||
// console.log('changecol', mytable.value)
|
||||
if (!!mytable.value) {
|
||||
if (mytable.value) {
|
||||
const arrcol = []
|
||||
let col: IColGridTable = { name: '', sortable: false }
|
||||
for (col of mycolumns.value) {
|
||||
@@ -2048,7 +2057,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function changeTable(mysel: any, mounted: boolean) {
|
||||
function changeTable(mysel: any) {
|
||||
// console.log('changeTable', tablesel.value)
|
||||
changetable.value = true
|
||||
if (tablesel.value === undefined || tablesel.value === '')
|
||||
@@ -2086,7 +2095,7 @@ export default defineComponent({
|
||||
// console.log('tablesList:')
|
||||
// console.table(tablesList)
|
||||
|
||||
if (!!mycolumns.value) {
|
||||
if (mycolumns.value) {
|
||||
mycolumns.value.forEach((rec: IColGridTable) => {
|
||||
if (rec.label_trans)
|
||||
rec.label = t(rec.label_trans)
|
||||
@@ -2097,13 +2106,13 @@ export default defineComponent({
|
||||
mytable.value = mytab.value
|
||||
}
|
||||
|
||||
if (!!props.tablesList) {
|
||||
if (props.tablesList) {
|
||||
tools.setCookie('tablesel', tablesel.value)
|
||||
}
|
||||
|
||||
updatedcol()
|
||||
|
||||
if (!!mytable.value) {
|
||||
if (mytable.value) {
|
||||
// Leggi la lista delle colonne visibili:
|
||||
const myselcol = tools.getCookie(mytable.value + '_', '')
|
||||
|
||||
@@ -2278,7 +2287,7 @@ export default defineComponent({
|
||||
return false
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ok
|
||||
@@ -2331,11 +2340,11 @@ export default defineComponent({
|
||||
// Add the column
|
||||
if (col.field_toduplicate_nospace) {
|
||||
//
|
||||
let trovato = tools.removespecial_chars(myobj[col.name])
|
||||
const trovato = tools.removespecial_chars(myobj[col.name])
|
||||
if (myobj[col.field_toduplicate_nospace] === '') {
|
||||
myobj[col.field_toduplicate_nospace] = trovato
|
||||
}
|
||||
let attuale = tools.removespecial_chars(myobj[col.field_toduplicate_nospace])
|
||||
const attuale = tools.removespecial_chars(myobj[col.field_toduplicate_nospace])
|
||||
myobj[col.field_toduplicate_nospace] = attuale
|
||||
// console.log('trovato', trovato, 'name', myobj[col.name], 'duplicate:', myobj[col.field_toduplicate_nospace], 'orig', myobj[col.name])
|
||||
}
|
||||
@@ -2345,7 +2354,7 @@ export default defineComponent({
|
||||
|
||||
const data = await globalStore.saveTable(mydata)
|
||||
.then((ris) => {
|
||||
if (ris.hasOwnProperty('code')) {
|
||||
if (tools.existProp(ris, 'code')) {
|
||||
tools.checkErrors($q, ris.code, '')
|
||||
} else {
|
||||
if (ris) {
|
||||
@@ -2693,7 +2702,7 @@ export default defineComponent({
|
||||
mapInitialized.value = true
|
||||
boundariesMap.value = { ne, sw }
|
||||
|
||||
// Verifica se boundariesMap è variato da precedente valore,
|
||||
// Verifica se boundariesMap è variato da precedente valore,
|
||||
// ma solo se ci sono nuovi pezzi delle mappa in più mostrati, quindi se è stato fatto un zoom in, non includerlo
|
||||
|
||||
const percrange = 0.15 //15%
|
||||
|
||||
Reference in New Issue
Block a user