PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,25 +1,28 @@
|
||||
import { defineComponent, PropType, ref, watch, toRef, onMounted, toRefs, computed, inject } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, ref, watch, toRef, onMounted, toRefs, computed, inject } 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,
|
||||
ISearchList,
|
||||
IPagination,
|
||||
IParamDialog,
|
||||
IMySkill,
|
||||
IMySkill
|
||||
} 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'
|
||||
@@ -35,7 +38,7 @@ 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 { useRouter } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
@@ -650,19 +653,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 {
|
||||
@@ -794,7 +797,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
|
||||
@@ -1298,14 +1301,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)
|
||||
@@ -1478,7 +1481,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
|
||||
|
||||
@@ -1536,7 +1539,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)
|
||||
}
|
||||
@@ -1546,7 +1549,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
|
||||
@@ -1555,10 +1558,10 @@ 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
|
||||
}
|
||||
@@ -1692,7 +1695,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) {
|
||||
@@ -1751,7 +1754,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)
|
||||
@@ -1762,13 +1765,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 + '_', '')
|
||||
|
||||
@@ -1991,11 +1994,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])
|
||||
}
|
||||
@@ -2005,7 +2008,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) {
|
||||
@@ -2114,7 +2117,7 @@ export default defineComponent({
|
||||
function showColCheck(col: IColGridTable, tipovis: number, visulabel: boolean, value: any = '', record: any = null) {
|
||||
|
||||
if (col.isadvanced_field && !showfilteradv.value)
|
||||
return false
|
||||
return false
|
||||
|
||||
const check = tools.checkIfShowField(col, tipovis, visulabel, value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user