@metano/quasar_rest_auth 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.gitattributes +17 -0
  2. package/LICENSE +21 -0
  3. package/Makefile +18 -0
  4. package/README.md +6 -0
  5. package/boot/alerts.js +152 -0
  6. package/boot/api.js +155 -0
  7. package/boot/app.js +111 -0
  8. package/boot/base.js +242 -0
  9. package/boot/config.js +117 -0
  10. package/boot/cripto.js +35 -0
  11. package/boot/data.js +28 -0
  12. package/boot/storage.js +74 -0
  13. package/components/DefinicoesLayout.vue +34 -0
  14. package/components/FormLogin.vue +217 -0
  15. package/components/LeftMenu.vue +93 -0
  16. package/components/LeftMenuSegundo.vue +96 -0
  17. package/components/MyTest.vue +41 -0
  18. package/components/RightMenu.vue +36 -0
  19. package/components/SearchMenu.vue +88 -0
  20. package/components/SettingsLayout.vue +34 -0
  21. package/components/TopMenu.vue +68 -0
  22. package/components/TopMenuSegundo.vue +85 -0
  23. package/components/footer/Comments.vue +77 -0
  24. package/components/footer/MainFooter.vue +71 -0
  25. package/components/header/HeaderBrand.vue +64 -0
  26. package/components/header/HeaderDarkModeToggle.vue +40 -0
  27. package/components/header/HeaderFullScreen.vue +55 -0
  28. package/components/header/HeaderLanguage.vue +56 -0
  29. package/components/header/HeaderNotifications.vue +53 -0
  30. package/components/header/HeaderServices.vue +118 -0
  31. package/components/header/HeaderUser.vue +210 -0
  32. package/components/header/HeaderUserMenu.vue +0 -0
  33. package/components/header/RegistarEntidade.vue +309 -0
  34. package/gitignore +3 -0
  35. package/help +9 -0
  36. package/index.js +9 -0
  37. package/layouts/AuthLayout.vue +74 -0
  38. package/layouts/MainLayout.vue +190 -0
  39. package/package.json +31 -0
  40. package/pages/auth/LoginPage.vue +32 -0
  41. package/pages/routes.js +33 -0
  42. package/stores/AuthStore.js +587 -0
  43. package/stores/example-store.js +21 -0
  44. package/stores/index.js +20 -0
  45. package/stores/settings.js +12 -0
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div >
3
+ <q-btn class="q-mr-xs" flat square
4
+ v-for="App in Auth.TipoEntidadeMenus" :key="App"
5
+ style="padding: 0px;"
6
+ v-show="User.EntidadeModulos.includes(App.app) && User.isAuthorized(App.app.toLowerCase())"
7
+ :icon="App.icon"
8
+ :label="tdc(App.menu)"
9
+ >
10
+
11
+ <q-menu auto-close>
12
+ <q-list style="min-width: 155px">
13
+ <q-item v-for="sm in App.submenu" :key="sm"
14
+ dense
15
+ clickable v-ripple
16
+ :to="{name: sm?.rota}"
17
+ v-show="User.isAuthorized(sm.role.toLowerCase())"
18
+ >
19
+ <q-item-section avatar>
20
+ <q-icon :name="sm.icon" :color="$q.dark.isActive ? '' : 'text-primary'" />
21
+ </q-item-section>
22
+ <q-item-section :color="$q.dark.isActive ? '' : 'text-primary'">{{tdc(sm.menu)}}</q-item-section>
23
+ <q-item-section side >
24
+ <q-item dense style="margin-right: -20px;"
25
+ v-show="User.isAuthorized('add_' + sm.menu.toLowerCase())"
26
+ clickable v-ripple
27
+ :to="{name: 'add_' + sm.menu.toLowerCase()}"
28
+ >
29
+ <q-icon name="add" size="sm" :color="$q.dark.isActive ? '' : 'primary'">
30
+ <q-tooltip :class="$q.dark.isActive ? 'bg-dark' : 'bg-primary'">
31
+ {{ tdc('Adicionar ') }} {{ tdc(sm.menu) }}
32
+ </q-tooltip>
33
+ </q-icon>
34
+ </q-item>
35
+ </q-item-section>
36
+ </q-item>
37
+ </q-list>
38
+ </q-menu>
39
+ </q-btn>
40
+ </div>
41
+ </template>
42
+
43
+ <script >
44
+
45
+ import { defineComponent } from 'vue'
46
+ import { tdc } from '../boot/app'
47
+ import { UserStore, AuthStore } from '../stores/AuthStore'
48
+
49
+
50
+
51
+ export default defineComponent({
52
+ name: 'TopeMenuSegundo',
53
+
54
+ components: {
55
+ },
56
+ setup () {
57
+
58
+ const User = UserStore()
59
+ const Auth = AuthStore()
60
+
61
+ return {
62
+ User,
63
+ Auth,
64
+ tdc
65
+ }
66
+ },
67
+ data () {
68
+ return {
69
+
70
+ }
71
+ },
72
+ computed: {
73
+
74
+ },
75
+ watch: {
76
+
77
+ },
78
+ mounted () {
79
+
80
+ },
81
+ methods: {
82
+
83
+ }
84
+ })
85
+ </script>
@@ -0,0 +1,77 @@
1
+
2
+ <template>
3
+ <div class="">
4
+ <q-card>
5
+ <q-bar :class="$q.dark.isActive ? 'bg-primary text-white' : 'bg-primary text-white'">
6
+ &nbsp; {{tdc('Enviar comentário ou opinião')}}
7
+ <q-space />
8
+ <q-btn dense flat icon="close" v-close-popup>
9
+ <q-tooltip>{{tdc('Fechar')}}</q-tooltip>
10
+ </q-btn>
11
+ </q-bar>
12
+
13
+ <q-card-section >
14
+ <q-input outlined
15
+ v-model="comment_text"
16
+ class=""
17
+ dense
18
+ :placeholder="tdc('Tem algum feedback? Adoraríamos ouvir; mas não compartilhe informações confidenciais. Tem perguntas? Tente ajuda ou suporte.')"
19
+ type="textarea"
20
+ :rules="[ val => val && val.length > 0 || tdc('Este campo e obrigatório.')]"
21
+ />
22
+ </q-card-section>
23
+
24
+ <q-card-section >
25
+ {{tdc('Algumas informações da conta e do sistema podem ser enviadas para a Mytech. Nós o usaremos para corrigir problemas e melhorar nossos serviços de acordo com nossa Política de Privacidade e Termos de Serviço. Podemos enviar um e-mail para mais informações ou atualizações. Vá para a Ajuda Jurídica para solicitar alterações de conteúdo por motivos legais.')}}
26
+ </q-card-section>
27
+ <q-separator />
28
+
29
+ <q-card-actions align="right">
30
+ <q-btn v-close-popup :color="$q.dark.isActive ? '' : 'dark'" >{{tdc('Cancelar')}}</q-btn>
31
+ <q-btn :color="$q.dark.isActive ? 'primary' : 'primary'" type="submit" @click="comentar" > {{tdc('Enviar')}}</q-btn>
32
+ </q-card-actions>
33
+ </q-card>
34
+
35
+ </div>
36
+ </template>
37
+
38
+ <script>
39
+ import { defineComponent } from 'vue'
40
+ import { tdc } from '../../boot/app'
41
+
42
+ export default defineComponent({
43
+
44
+ setup () {
45
+ return {
46
+
47
+ }
48
+ },
49
+ props: {
50
+ css: {
51
+ type: String,
52
+ required: false,
53
+ default: ''
54
+ }
55
+ },
56
+
57
+ data () {
58
+ return {
59
+ tdc: tdc
60
+ }
61
+ },
62
+ created () {
63
+ },
64
+ computed: {
65
+ },
66
+ mounted () {
67
+
68
+ },
69
+
70
+ methods: {
71
+
72
+ modal_comment () {
73
+ this.comment = !this.comment
74
+ }
75
+ }
76
+ })
77
+ </script>
@@ -0,0 +1,71 @@
1
+
2
+ <template>
3
+ <div class="">
4
+ <q-dialog v-model="comment" persistent>
5
+ <Comments />
6
+ </q-dialog>
7
+ <q-footer v-if=" true" bordered :class="$q.dark.isActive ? 'bg-dark text-white' : 'bg-primary text-white'">
8
+ <q-toolbar>
9
+ <q-toolbar-title>
10
+ <div class="row q-py-sm justify-between ">
11
+ <div class="col-md-9 items-center" style="font-size:13px;" >
12
+ &copy; {{ User?.Entidade?.created_at==null? '2020' : User?.Entidade?.created_at }} - {{ new Date().getFullYear() }} {{ User?.Entidade?.tipoEntidade }} {{ User?.Entidade?.nome }}
13
+ </div>
14
+ <div class="col-md-3 text-right items-center" style="font-size:12px;">
15
+ {{ Load.count }} <label @click="this.comment = !this.comment"> {{tdc('Enviar comentário ou opinião')}} </label>
16
+ </div>
17
+ </div>
18
+ </q-toolbar-title>
19
+ </q-toolbar>
20
+ </q-footer>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { defineComponent } from 'vue'
26
+ import { tdc } from '../../boot/app';
27
+ import { LoadStore, UserStore } from '../../stores/AuthStore';
28
+ import Comments from "./Comments.vue";
29
+
30
+
31
+ export default defineComponent({
32
+
33
+ components: {
34
+ Comments
35
+ },
36
+
37
+ setup () {
38
+ const User = UserStore
39
+ const Load = LoadStore()
40
+ return {
41
+ User,
42
+ Load
43
+ }
44
+ },
45
+ props: {
46
+ css: {
47
+ type: String,
48
+ required: false,
49
+ default: ''
50
+ }
51
+ },
52
+
53
+ data () {
54
+ return {
55
+ comment: false,
56
+ tdc: tdc,
57
+ }
58
+ },
59
+ created () {
60
+ },
61
+ computed: {
62
+ },
63
+ mounted () {
64
+
65
+ },
66
+
67
+ methods: {
68
+
69
+ }
70
+ })
71
+ </script>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="row items-center no-wrap q-gutter-sm">
3
+ <q-avatar size="40px">
4
+ <img v-if="User.Entidade" :src="User?.Entidade?.logo" />
5
+ <img v-else :src="User.TipoEntidade?.icon?.url" />
6
+ </q-avatar>
7
+
8
+ <div class="text-h6 text-weight-medium">
9
+ <label v-if="User?.Entidade">
10
+ {{ tdc(User?.Entidade?.nome) }}
11
+
12
+ <q-tooltip
13
+ v-if="User?.Sucursal?.nome"
14
+ :class="$q.dark.isActive
15
+ ? 'bg-dark text-white text-subtitle1'
16
+ : 'bg-primary text-white text-subtitle1'"
17
+ >
18
+ {{ tdc(User?.Sucursal?.nome) }}
19
+ </q-tooltip>
20
+ </label>
21
+ <label v-else >{{tdc( User.TipoEntidade?.nome )}}</label>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+
28
+ import { defineComponent } from 'vue'
29
+ import { AuthStore, UserStore } from '../../stores/AuthStore'
30
+ import { tdc } from '../../boot/app';
31
+
32
+
33
+ export default defineComponent({
34
+ components: {
35
+
36
+ },
37
+ setup () {
38
+ const Auth = AuthStore()
39
+ const User = UserStore()
40
+ return {
41
+ Auth,
42
+ User,
43
+ tdc
44
+ }
45
+ },
46
+ data () {
47
+ return {
48
+
49
+ }
50
+ },
51
+ computed: {
52
+
53
+ },
54
+
55
+ mounted(){
56
+
57
+ },
58
+
59
+ methods: {
60
+
61
+
62
+ }
63
+ })
64
+ </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <q-btn
3
+ dense flat round
4
+ :icon="$q.dark.isActive ? 'mdi-weather-night' : 'mdi-white-balance-sunny'"
5
+ @click="toggleDark"
6
+ >
7
+ <q-tooltip
8
+ :class="$q.dark.isActive ? 'bg-dark text-white' : 'bg-primary text-white'"
9
+ >
10
+ {{ $q.dark.isActive ? tdc('Clique para modo dia') : tdc('Clique para modo noite') }}
11
+ </q-tooltip>
12
+ </q-btn>
13
+ </template>
14
+
15
+
16
+ <script>
17
+ import { defineComponent } from 'vue'
18
+ import { tdc } from '../../boot/app'
19
+ import { getStorage, setStorage } from '../../boot/base'
20
+
21
+ export default defineComponent({
22
+ name: 'HeaderDarkMode',
23
+ data () {
24
+ return {
25
+ tdc: tdc
26
+ }
27
+ },
28
+ mounted() {
29
+ const isDark = ('' + getStorage('c', 'dark')).toLowerCase() === 'true'
30
+ this.$q.dark.set(isDark)
31
+ },
32
+ methods: {
33
+ toggleDark () {
34
+ const newValue = !this.$q.dark.isActive
35
+ this.$q.dark.set(newValue)
36
+ setStorage('c', 'dark', newValue, 365)
37
+ }
38
+ }
39
+ })
40
+ </script>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <q-btn flat dense round
3
+ :icon="fullscreen ? 'fullscreen_exit' : 'fullscreen'"
4
+ @click="toggleFullScreen" >
5
+ <q-tooltip :class="$q.dark.isActive ? 'bg-transparent' : 'bg-primary'">
6
+ {{ fullscreen ? tdc('Clique para desactivar da tela cheia'): tdc('Clique para activar da tela cheia') }}
7
+ </q-tooltip>
8
+ </q-btn>
9
+ </template>
10
+
11
+ <script>
12
+ import { defineComponent } from 'vue'
13
+ import { tdc } from '../../boot/app'
14
+ import { getStorage, setStorage } from '../../boot/base'
15
+ export default defineComponent({
16
+ components: {
17
+
18
+ },
19
+ setup () {
20
+ return {
21
+ }
22
+ },
23
+ data () {
24
+ return {
25
+ fullscreen: false,
26
+ tdc: tdc
27
+ }
28
+ },
29
+ computed: {
30
+
31
+ },
32
+
33
+ mounted(){
34
+ document.addEventListener("fullscreenchange", () => {
35
+ this.fullscreen = !!document.fullscreenElement
36
+ })
37
+ this.fullscreen = ('' + getStorage('c', 'FullScreen')).toLowerCase() === 'true'
38
+ },
39
+
40
+ methods: {
41
+ toggleFullScreen() {
42
+ if (!document.fullscreenElement) {
43
+ document.documentElement.requestFullscreen()
44
+ this.fullscreen = !!document.fullscreenElement
45
+ setStorage('c', 'FullScreen', this.fullscreen, 365)
46
+ } else if (document.exitFullscreen) {
47
+ document.exitFullscreen()
48
+ this.fullscreen = !!document.fullscreenElement
49
+ setStorage('c', 'FullScreen', this.fullscreen, 365)
50
+ }
51
+
52
+ }
53
+ }
54
+ })
55
+ </script>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <q-btn dense flat round icon="language">
3
+ <q-menu>
4
+ <q-list dense>
5
+ <q-item
6
+ v-for="idioma in Language.list"
7
+ :key="idioma"
8
+ clickable
9
+ @click="Language?.change(idioma)"
10
+ >
11
+ <q-item-section v-if="Language.current?.id == idioma.id" ><b>{{ idioma.nome }}</b></q-item-section>
12
+ <q-item-section v-else >{{ idioma.nome }}</q-item-section>
13
+ </q-item>
14
+ </q-list>
15
+ </q-menu>
16
+ <q-tooltip :class="$q.dark.isActive ? 'bg-dark text-white' : 'bg-primary text-white'">
17
+ {{Language.current?.nome }}
18
+ </q-tooltip>
19
+ </q-btn>
20
+ </template>
21
+
22
+ <script>
23
+ import { defineComponent } from 'vue'
24
+ import { UserStore, LanguageStore} from '../../stores/AuthStore'
25
+
26
+
27
+ export default defineComponent({
28
+ components: {
29
+
30
+ },
31
+ setup () {
32
+ const User = UserStore()
33
+ const Language = LanguageStore()
34
+ return {
35
+ User,
36
+ Language
37
+ }
38
+ },
39
+ data () {
40
+ return {
41
+
42
+ }
43
+ },
44
+ computed: {
45
+
46
+ },
47
+
48
+ async mounted(){
49
+ await this.Language.get()
50
+ },
51
+
52
+ methods: {
53
+
54
+ }
55
+ })
56
+ </script>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <q-btn flat round dense @click="verNotificacoes()"
3
+ :class="$q.dark.isActive ? 'bg-dark text-white' : 'bg-primary text-white'"
4
+ >
5
+ <q-icon name="notifications" />
6
+ <q-badge v-if="unreadCount > 0" color="red" floating transparent>
7
+ {{ unreadCount }}
8
+ </q-badge>
9
+ <q-tooltip :class="$q.dark.isActive ? 'bg-dark text-white' : 'bg-primary text-white'">
10
+ {{tdc('Ver notificações')}}
11
+ </q-tooltip>
12
+ </q-btn>
13
+ </template>
14
+
15
+ <script >
16
+ import { defineComponent } from 'vue'
17
+ import { tdc } from '../../boot/app'
18
+
19
+
20
+ export default defineComponent({
21
+ components: {
22
+
23
+ },
24
+ setup () {
25
+
26
+ return {
27
+
28
+ }
29
+ },
30
+ data () {
31
+ return {
32
+ unreadCount: 3,
33
+ tdc: tdc
34
+ }
35
+ },
36
+ computed: {
37
+
38
+ },
39
+
40
+ mounted(){
41
+
42
+ },
43
+
44
+ methods: {
45
+ verNotificacoes() {
46
+
47
+ }
48
+ }
49
+ })
50
+ </script>
51
+ <style scoped>
52
+ /* Estilos específicos do HeaderServices */
53
+ </style>
@@ -0,0 +1,118 @@
1
+ <template>
2
+ <div>
3
+ <!-- Conteúdo do HeaderServices -->
4
+ <q-btn round dense flat size="14px" icon="apps">
5
+ <q-tooltip :class="$q.dark.isActive ? 'bg-transparent' : 'bg-primary'" >{{tdc("Serviços")}}</q-tooltip>
6
+ <q-menu flat bordered square fit :offset="[175, 5]" >
7
+ <q-card class="my-card" style="min-width:270px;" >
8
+ <q-card-section class="text-center" flat bordered square >
9
+ <q-scroll-area
10
+ :thumb-style="thumbStyle"
11
+ :bar-style="barStyle"
12
+ style="height: 300px"
13
+ >
14
+ <div class="row col-xs-12" >
15
+ <div v-for=" te in Auth?.TipoEntidades" :key="te">
16
+ <q-item v-close-popup flat bordered class="col-4 " v-if="getHostname(te)" >
17
+ <q-item-label clickable @click="selectteidadeLink(te)" class="localhover">
18
+ <q-avatar class="" size="45px" style="border-radius:5px;" >
19
+ <img :src="te?.icon?.url" >
20
+ </q-avatar>
21
+ <br>
22
+ {{tdc(te.nome)}}
23
+ </q-item-label>
24
+ </q-item >
25
+ </div>
26
+ </div>
27
+ </q-scroll-area>
28
+ </q-card-section>
29
+ </q-card>
30
+ </q-menu>
31
+ </q-btn>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ import { defineComponent } from 'vue'
37
+ import { tdc } from '../../boot/app'
38
+ import { AuthStore, UserStore } from '../../stores/AuthStore'
39
+ import { setStorage } from '../../boot/storage';
40
+
41
+
42
+ export default defineComponent({
43
+
44
+ setup () {
45
+ const User = UserStore()
46
+ const Auth = AuthStore()
47
+ return {
48
+ User,
49
+ Auth
50
+ }
51
+ },
52
+ props: {
53
+
54
+ },
55
+
56
+ data () {
57
+ return {
58
+ tdc: tdc
59
+ }
60
+ },
61
+ created () {
62
+ },
63
+ computed: {
64
+ },
65
+ async mounted () {
66
+ await this.Auth.getTipoEntidades()
67
+ this.Auth?.TipoEntidades?.forEach(entidade => {
68
+ this.getHostname(entidade)
69
+ })
70
+ },
71
+
72
+ methods: {
73
+ isIP(host) {
74
+ return /^\d{1,3}(\.\d{1,3}){3}$/.test(host) || host.includes(":");
75
+ },
76
+ getHostname (tipoEnt) {
77
+ let domain = ''
78
+
79
+ if (this.isIP(window.location.hostname)){
80
+ const url = new URL(window.location.href);
81
+ const tipoentidade = url.pathname.split("/").filter(Boolean)[0];
82
+ domain = tipoentidade
83
+ }else{
84
+ domain = window.location.href.split('/')[2].split('.')[0]
85
+ if (domain === 'www') {
86
+ domain = window.location.href.split('/')[2].split('.')[1]
87
+ }
88
+ }
89
+
90
+ if(domain){
91
+ if (domain.toLocaleLowerCase() !== tipoEnt.nome.toLowerCase()) {
92
+ return true
93
+ } else {
94
+ this.User.TipoEntidade = tipoEnt
95
+ this.Auth.TipoEntidade = tipoEnt
96
+ setStorage('c', 'tipoEntidade', JSON.stringify(this.User.TipoEntidade))
97
+ return false
98
+ }
99
+ }
100
+
101
+ },
102
+
103
+
104
+ selectteidadeLink(x){
105
+ var url = ''
106
+ if (this.isIP(window.location.hostname)){
107
+ url = new URL(window.location.href)
108
+ url.pathname = `/${x.nome}/`
109
+ }else{
110
+ url = ''
111
+ }
112
+
113
+ window.open(url.toString(), '_blank');
114
+ }
115
+
116
+ }
117
+ })
118
+ </script>