Notifications
Settings Notifications User Panel
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { defineComponent, onMounted, ref } from 'vue'
|
||||
|
||||
import { computed } from 'vue'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CCopyBtn } from '@/components/CCopyBtn'
|
||||
import { CKeyAndValue } from '@/components/CKeyAndValue'
|
||||
@@ -31,12 +32,26 @@ export default defineComponent({
|
||||
const myuser = ref(<IUserFields>{_id: '', username: '', name: '', surname: '', profile: DefaultProfile})
|
||||
const risultato = ref('')
|
||||
const mynotif = ref('')
|
||||
const mylink = ref('')
|
||||
const notiftype = ref(1)
|
||||
const notifdirtype = ref(1)
|
||||
const notifidtype = ref(1)
|
||||
|
||||
const listnotif = ref(<any>[])
|
||||
const listnotiftype = ref(<any>[])
|
||||
const { t } = useI18n();
|
||||
|
||||
const listnotifid = computed(() => {
|
||||
if (notifdirtype.value) {
|
||||
const mylist: any = shared_consts.TypeNotifs_Arr.find((rec: any) => rec.value === notifdirtype.value)
|
||||
if (mylist) {
|
||||
for (const rec of mylist.list) {
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
}
|
||||
|
||||
return mylist.list
|
||||
}
|
||||
return []
|
||||
})
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
@@ -50,6 +65,12 @@ export default defineComponent({
|
||||
for (const rec of listnotif.value) {
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
|
||||
listnotiftype.value = shared_consts.TypeNotifs_Arr
|
||||
for (const rec of listnotiftype.value) {
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function changeCol(newval: any) {
|
||||
@@ -83,11 +104,11 @@ export default defineComponent({
|
||||
|
||||
if (!!myuser.value) {
|
||||
const notif: INotif = {
|
||||
type: notiftype.value,
|
||||
typedir: notifdirtype.value,
|
||||
typeid: notifidtype.value,
|
||||
sender: userStore.my.username,
|
||||
dest: myuser.value.username,
|
||||
descr: mynotif.value,
|
||||
link: mylink.value,
|
||||
}
|
||||
await notifStore.SendNotifEvent(notif)
|
||||
|
||||
@@ -112,9 +133,11 @@ export default defineComponent({
|
||||
sendNotifToUser,
|
||||
risultato,
|
||||
mynotif,
|
||||
mylink,
|
||||
notiftype,
|
||||
notifdirtype,
|
||||
notifidtype,
|
||||
listnotif,
|
||||
listnotiftype,
|
||||
listnotifid,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user