ver 1.1.20:
- corretto campo foto che non compariva più. - sistemato i campi aggiuntivi e i richiesti. - migliorato la barra in alto di selezione. - aggiunto alcune icone.
This commit is contained in:
199
src/components/CCatalogList/CCatalogList.ts
Executable file
199
src/components/CCatalogList/CCatalogList.ts
Executable file
@@ -0,0 +1,199 @@
|
||||
import {
|
||||
computed,
|
||||
provide, 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 { CTitlePage } from '@/components/CTitlePage'
|
||||
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||
import { IColGridTable, IMyBacheca, IMySkill, ISearchList, ISkill } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CCatalogList',
|
||||
emits: ['clickButtBar'],
|
||||
props: {
|
||||
ind: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: -1,
|
||||
},
|
||||
prop_search: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
finder: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
heightcarousel: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CMyFieldDb, CGridTableRec, CTitlePage,
|
||||
},
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
const globalStore = useGlobalStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const table = ref('catalogs')
|
||||
|
||||
const searchList_Base = ref(<ISearchList[]>[])
|
||||
|
||||
const arrfilterand: any = ref([])
|
||||
const filtercustom: any = ref([])
|
||||
|
||||
const search = ref('')
|
||||
const myrecfiltertoggle = ref(tools.FILTER_ALL)
|
||||
|
||||
const prop_colkey = ref('')
|
||||
const col_title = ref('')
|
||||
const col_footer = ref('')
|
||||
const col_tabfooter = ref('')
|
||||
|
||||
const strextra = ref('')
|
||||
const myoptions = ref(<any>[])
|
||||
|
||||
const col = ref(<IColGridTable[]>[])
|
||||
|
||||
const myCatRef = ref(<any>null)
|
||||
|
||||
/*
|
||||
const idSectorServizi = computed(() => {
|
||||
let myval: any = null
|
||||
myval = searchList_Servizi.value.find((rec) => (rec.table === toolsext.TABSECTORS))
|
||||
if (myval) {
|
||||
const ris = myval.value || 0
|
||||
// console.log('idSectorServizi=', ris)
|
||||
return ris
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
})
|
||||
|
||||
*/
|
||||
|
||||
|
||||
function updatefilter(value: any) {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
|
||||
updatefilter(value)
|
||||
},
|
||||
)
|
||||
|
||||
const mypagination = computed(() => {
|
||||
return { sortBy: 'title', descending: false, page: 1, rowsNumber: 0, rowsPerPage: 10 }
|
||||
})
|
||||
|
||||
const searchList = computed(() => {
|
||||
return searchList_Base.value
|
||||
})
|
||||
|
||||
const showType = computed(() => {
|
||||
return costanti.SHOW_MYCARD
|
||||
})
|
||||
|
||||
const hint = computed(() => {
|
||||
return 'digita una parola da cercare'
|
||||
})
|
||||
|
||||
const visuType = computed(() => {
|
||||
return false // $q.screen.gt.xs
|
||||
})
|
||||
|
||||
const noMsgRecord = computed(() => {
|
||||
return 'Nessun dato trovato con i filtri selezionati'
|
||||
})
|
||||
|
||||
|
||||
function mounted() {
|
||||
|
||||
let obj = tools.getParamsByTable(table.value)
|
||||
|
||||
|
||||
prop_colkey.value = obj.prop_colkey
|
||||
col_title.value = obj.col_title
|
||||
col_footer.value = obj.col_footer
|
||||
col_tabfooter.value = obj.col_tabfooter
|
||||
|
||||
searchList_Base.value = []
|
||||
|
||||
filtercustom.value = []
|
||||
|
||||
col.value = fieldsTable.getArrColsByTable(table.value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function mySortFieldsAvailable() {
|
||||
if (table.value === toolsext.TABUSER) {
|
||||
return userStore.getSortFieldsAvailable()
|
||||
}
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doSearch() {
|
||||
//
|
||||
}
|
||||
|
||||
function clickButtBar(item: any) {
|
||||
if (myCatRef.value) {
|
||||
myCatRef.value.clickButtBar(item)
|
||||
}
|
||||
|
||||
// emit('clickButtBar', item)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
t,
|
||||
tools,
|
||||
costanti,
|
||||
arrfilterand,
|
||||
filtercustom,
|
||||
searchList,
|
||||
search,
|
||||
doSearch,
|
||||
myrecfiltertoggle,
|
||||
prop_colkey,
|
||||
col_title,
|
||||
col_footer,
|
||||
col_tabfooter,
|
||||
col,
|
||||
toolsext,
|
||||
mypagination,
|
||||
noMsgRecord,
|
||||
showType,
|
||||
visuType,
|
||||
hint,
|
||||
myoptions,
|
||||
mySortFieldsAvailable,
|
||||
clickButtBar,
|
||||
myCatRef,
|
||||
table,
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user