other components... (2)
This commit is contained in:
0
src/components/CHours/CHours.scss
Executable file
0
src/components/CHours/CHours.scss
Executable file
100
src/components/CHours/CHours.ts
Executable file
100
src/components/CHours/CHours.ts
Executable file
@@ -0,0 +1,100 @@
|
||||
import { colTableHours } from '@src/store/Modules/fieldsTable'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { defineComponent, ref } from 'vue'
|
||||
import { IPagination } from 'model'
|
||||
import { CImgText } from '@/components/CImgText'
|
||||
import { CCard } from '../CCard'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CHours',
|
||||
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
|
||||
props: {
|
||||
todoId: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
setup(props){
|
||||
const userStore = useUserStore()
|
||||
|
||||
const pagination = ref(<IPagination> {
|
||||
sortBy: 'descr',
|
||||
descending: false,
|
||||
page: 2,
|
||||
rowsPerPage: 5
|
||||
// rowsNumber: xx if getting data from a server
|
||||
})
|
||||
|
||||
function extraparams() {
|
||||
return {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
todoId: 1, userId: 1, descr: 1, date: 1, time_start: 1, time_end: 1, hours: 1,
|
||||
username: 1, name: 1, surname: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const arrfilterand = [
|
||||
{
|
||||
label: 'Tutte le ore',
|
||||
value: shared_consts.FILTER_HOURS_ALL
|
||||
}
|
||||
]
|
||||
|
||||
function myfilterdef() {
|
||||
return [shared_consts.FILTER_HOURS_MYLIST]
|
||||
}
|
||||
|
||||
function myarrfilterand() {
|
||||
const myfiltrodef = {
|
||||
label: 'Mie Ore',
|
||||
value: shared_consts.FILTER_HOURS_MYLIST,
|
||||
hide: true,
|
||||
default: true
|
||||
}
|
||||
let myarr = []
|
||||
myarr.push(myfiltrodef)
|
||||
if (arrfilterand)
|
||||
myarr = [...myarr, ...arrfilterand]
|
||||
|
||||
return myarr
|
||||
}
|
||||
|
||||
// const selected = []
|
||||
|
||||
function getcolHours() {
|
||||
return colTableHours
|
||||
}
|
||||
|
||||
function getdefaultnewrec() {
|
||||
const myrec: any = {
|
||||
todoId: props.todoId,
|
||||
userId: userStore.my._id,
|
||||
descr: ''
|
||||
}
|
||||
|
||||
return myrec
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
myfilterdef,
|
||||
myarrfilterand,
|
||||
extraparams,
|
||||
getcolHours,
|
||||
getdefaultnewrec,
|
||||
pagination,
|
||||
}
|
||||
},
|
||||
})
|
||||
27
src/components/CHours/CHours.vue
Executable file
27
src/components/CHours/CHours.vue
Executable file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<CGridTableRec
|
||||
prop_mytable="hours"
|
||||
prop_mytitle="Lista Ore"
|
||||
:prop_mycolumns="getcolHours"
|
||||
prop_colkey="descr"
|
||||
nodataLabel="Nessuna Lista Ore"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
||||
:arrfilters="myarrfilterand"
|
||||
:filterdef="myfilterdef"
|
||||
:prop_codeId="todoId"
|
||||
:defaultnewrec="getdefaultnewrec"
|
||||
:extraparams="extraparams"
|
||||
labeladd="Aggiungi Ora">
|
||||
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./CHours.ts">
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'CHours.scss';
|
||||
</style>
|
||||
1
src/components/CHours/index.ts
Executable file
1
src/components/CHours/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CHours} from './CHours.vue'
|
||||
Reference in New Issue
Block a user