Notifiche - Tutti - non letti
This commit is contained in:
@@ -16,12 +16,12 @@ export default defineComponent({
|
||||
required: true,
|
||||
},
|
||||
myvalue: {
|
||||
type: String,
|
||||
type: [String, Number ],
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
mydate: {
|
||||
type: Date,
|
||||
type: [Date, String],
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<span v-if="mydate">
|
||||
<CDateTime
|
||||
v-model:value="mydate"
|
||||
label=""
|
||||
:canEdit="false">
|
||||
</CDateTime>
|
||||
</span>
|
||||
|
||||
@@ -164,6 +164,7 @@ export default defineComponent({
|
||||
|
||||
} else {
|
||||
if (tools.isBitActive(myval.value, rec[props.optval])) {
|
||||
// console.log('rec', rec, 'props.optlab', props.optlab)
|
||||
const mydata = {
|
||||
label: t(tools.getValueByFunzOrVal(rec, props.optlab)),
|
||||
value: rec[props.optval],
|
||||
|
||||
@@ -6,7 +6,7 @@ import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { CMyPopupEdit } from '@/components/CMyPopupEdit'
|
||||
import { IColGridTable } from 'model'
|
||||
import { IColGridTable, IOperators, ISpecialField } from 'model'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
|
||||
|
||||
@@ -26,6 +26,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
specialField: {
|
||||
type: Object as PropType<ISpecialField>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
filter: {
|
||||
type: [String, Function],
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
indrec: {
|
||||
type: Number,
|
||||
required: false,
|
||||
@@ -128,7 +138,7 @@ export default defineComponent({
|
||||
console.log('showandsel CMyFieldDb', row, col, newval)
|
||||
|
||||
if (newval !== valinitial)
|
||||
setValDb($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey)
|
||||
setValDb($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
|
||||
function withBorder() {
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
:table="table"
|
||||
:title="title"
|
||||
:field="mykey"
|
||||
:filter="filter"
|
||||
:subfield="mysubkey"
|
||||
:specialField="specialField"
|
||||
:mysubsubkey="mysubsubkey"
|
||||
:indrec="indrec"
|
||||
:type="type"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { CMyPopupEdit } from '@/components/CMyPopupEdit'
|
||||
import { IColGridTable } from 'model'
|
||||
import { IColGridTable, ISpecialField } from 'model'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
specialField: {
|
||||
type: Object as PropType<ISpecialField>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
myimg: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -146,7 +151,7 @@ export default defineComponent({
|
||||
console.log('showandsel CMyFieldDb', row, col, newval)
|
||||
|
||||
if (newval !== valinitial)
|
||||
setValDb($q, mykey.value, newval, props.fieldtype || col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value)
|
||||
setValDb($q, mykey.value, newval, props.fieldtype || col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value, props.specialField)
|
||||
}
|
||||
|
||||
function withBorder() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { IColGridTable, IImgGallery } from 'model'
|
||||
import { IColGridTable, IImgGallery, ISpecialField } from 'model'
|
||||
import { CMyChipList } from '../CMyChipList'
|
||||
import { CDate } from '../CDate'
|
||||
import { CDateTime } from '../CDateTime'
|
||||
@@ -89,6 +89,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
specialField: {
|
||||
type: Object as PropType<ISpecialField>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
serv: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -134,6 +139,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
filter: {
|
||||
type: [String, Function],
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
field_extra: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -231,9 +241,11 @@ export default defineComponent({
|
||||
|
||||
// console.table(props)
|
||||
|
||||
myvalue.value = getValDb(props.field, props.serv, '', props.table, props.subfield, props.id, props.idmain)
|
||||
myvalue.value = getValDb(props.field, props.serv, '', props.table, props.subfield, props.id, props.idmain, props.indrec, props.mysubsubkey, props.specialField)
|
||||
// console.log('myvalue.value', myvalue.value)
|
||||
col.value.jointable = props.jointable
|
||||
if (props.filter)
|
||||
col.value.filter = props.filter
|
||||
col.value.fieldtype = props.type
|
||||
col.value.label = props.title
|
||||
|
||||
@@ -459,7 +471,7 @@ export default defineComponent({
|
||||
function savefield(value: any, initialval: any, myq: any) {
|
||||
if (!props.insertMode) {
|
||||
myvalue.value = value
|
||||
setValDb(myq, props.field, myvalue.value, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey)
|
||||
setValDb(myq, props.field, myvalue.value, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,7 +486,7 @@ export default defineComponent({
|
||||
else
|
||||
myvalue.value = value
|
||||
|
||||
setValDb($q, props.field, myvalue, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey)
|
||||
setValDb($q, props.field, myvalue, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
|
||||
|
||||
|
||||
0
src/components/CNotifSettings/CNotifSettings.scss
Executable file
0
src/components/CNotifSettings/CNotifSettings.scss
Executable file
40
src/components/CNotifSettings/CNotifSettings.ts
Executable file
40
src/components/CNotifSettings/CNotifSettings.ts
Executable file
@@ -0,0 +1,40 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CNotifSettings',
|
||||
props: {
|
||||
},
|
||||
components: { CMyFieldDb },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
|
||||
function mounted() {
|
||||
//
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
t,
|
||||
tools,
|
||||
costanti,
|
||||
shared_consts,
|
||||
fieldsTable,
|
||||
globalStore,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
46
src/components/CNotifSettings/CNotifSettings.vue
Executable file
46
src/components/CNotifSettings/CNotifSettings.vue
Executable file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="text-center">
|
||||
<div class="row items-center justify-center q-gutter-md q-ma-xs">
|
||||
|
||||
<q-list bordered class="rounded-borders">
|
||||
<q-expansion-item v-for="(rec, index) in shared_consts.typeNotifs"
|
||||
:key="index"
|
||||
expand-separator
|
||||
icon="perm_identity"
|
||||
:label="t(rec.labeltrans)"
|
||||
>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<div>{{ t(rec.descr) }}</div>
|
||||
|
||||
<CMyFieldDb
|
||||
title=""
|
||||
table="users"
|
||||
mykey="profile"
|
||||
mysubkey="notifs"
|
||||
:specialField="{
|
||||
findsubkey: (myrec) => myrec.dir === rec.value,
|
||||
paramtosetsubkey: 'value',
|
||||
paramdef: rec.value,
|
||||
defaultnewrec: { dir: rec.value},
|
||||
}"
|
||||
jointable="usernotifs"
|
||||
tablesel="usernotifs"
|
||||
:filter="(myrec) => myrec.directory === rec.value"
|
||||
:type="costanti.FieldType.binary">
|
||||
</CMyFieldDb>
|
||||
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-expansion-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CNotifSettings.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CNotifSettings.scss';
|
||||
</style>
|
||||
1
src/components/CNotifSettings/index.ts
Executable file
1
src/components/CNotifSettings/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CNotifSettings} from './CNotifSettings.vue'
|
||||
@@ -55,4 +55,5 @@ export * from './COpenStreetMap'
|
||||
export * from './COperators'
|
||||
export * from './CFundRaising'
|
||||
export * from './CKeyAndValue'
|
||||
export * from './CNotifSettings'
|
||||
// export * from './CPreloadImages'
|
||||
|
||||
Reference in New Issue
Block a user