- Installa APP: Messaggio in CIMA

- in sistemazione: select compare la scelta di prima.
This commit is contained in:
Surya Paolo
2022-12-07 18:16:23 +01:00
parent 077c2dbd9e
commit 944d121943
29 changed files with 1119 additions and 752 deletions

View File

@@ -0,0 +1,54 @@
import { defineComponent, ref, computed, PropType, toRef } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools'
import { costanti, IMainCard } from '@store/Modules/costanti'
import { CBigBtn } from '@/components/CBigBtn'
export default defineComponent({
name: 'CCheckAppRunning',
components: { CBigBtn },
props: {},
setup(props, { emit }) {
const userStore = useUserStore()
const $router = useRouter()
const globalStore = useGlobalStore()
const { t } = useI18n()
const deferredPrompt = ref(<any>null)
const isAppRunning = computed(() => globalStore.isAppRunning )
const finishLoading = computed(() => globalStore.finishLoading)
function initprompt() {
window.addEventListener('beforeinstallprompt', (event) => {
event.preventDefault()
console.log('beforeinstallprompt !')
// Stash the event so it can be triggered later.
deferredPrompt.value = event
})
}
function installApp() {
if (deferredPrompt.value)
deferredPrompt.value.prompt()
}
initprompt()
return {
userStore,
tools,
costanti,
finishLoading,
deferredPrompt,
installApp,
isAppRunning,
}
}
})

View File

@@ -0,0 +1,31 @@
<template>
<div v-if="finishLoading && !isAppRunning && deferredPrompt" class="row justify-center">
<q-btn
glossy
size="xl"
label="Installa App"
@click="installApp"
icon="fas fa-mobile-alt"
color="white"
text-color="green"
/>
</div>
<!--<div class="row justify-center">
<CBigBtn
label="Info" to="" @click="showInfo = true" icon="fas fa-info" color="primary"
:numcol="3"
>
</CBigBtn>
</div>
<div v-if="showInfo">
</div>-->
</template>
<script lang="ts" src="./CCheckAppRunning.ts">
</script>
<style lang="scss" scoped>
@import './CCheckAppRunning.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CCheckAppRunning} from './CCheckAppRunning.vue'

View File

@@ -264,6 +264,7 @@ export default defineComponent({
const addRow = ref('Aggiungi')
const newRecordBool = ref(false)
const newRecordBoolOld = ref(false)
const editRecordBool = ref(false)
const newRecord: any = ref({})
const recSaved: any = ref({})
@@ -278,6 +279,7 @@ export default defineComponent({
const tablesel = ref('')
const loading = ref(false)
const editOn = ref(false)
const visupagedialog = ref(false)
const myrecdialog = ref(null)
@@ -1818,6 +1820,15 @@ export default defineComponent({
ris.username = userStore.my.username
}
if (userStore.my.profile) {
if (fieldsTable.tableforEnableCircuits.includes(props.prop_mytable)) {
if (!userStore.my.profile.calc.numGoodsAndServices)
userStore.my.profile.calc.numGoodsAndServices = 1
else
userStore.my.profile.calc.numGoodsAndServices += 1
}
}
// console.table(serverData.value)
if (indrec >= 0)
serverData.value[indrec] = ris
@@ -2153,6 +2164,8 @@ export default defineComponent({
t,
exportTable,
showNotification,
editOn,
newRecordBoolOld,
}
}
})

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,7 @@ import { CMyFieldRec } from '@src/components/CMyFieldRec'
import { CSelectColor } from '@src/components/CSelectColor'
import { CMainView } from '@src/components/CMainView'
import { CDashboard } from '@src/components/CDashboard'
import { CCheckAppRunning } from '@src/components/CCheckAppRunning'
import { CStatusReg } from '@src/components/CStatusReg'
import { CTitleBanner } from '@src/components/CTitleBanner'
import { CCheckIfIsLogged } from '@src/components/CCheckIfIsLogged'
@@ -44,7 +45,7 @@ export default defineComponent({
CSelectColor, CSelectFontSize, CImgPoster,
CCheckIfIsLogged, CStatusReg, CDashboard, CMainView, CNotifAtTop,
CPresentazione,
CTitleBanner, CShareSocial,
CTitleBanner, CShareSocial, CCheckAppRunning,
},
emits: ['selElemClick'],
props: {

View File

@@ -435,6 +435,10 @@
<div v-if="editOn" class="elemEdit">CMainView</div>
<CMainView></CMainView>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECKAPPRUNNING">
<div v-if="editOn" class="elemEdit">CheckAppRunning</div>
<CCheckAppRunning />
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.DASHBOARD">
<div v-if="editOn" class="elemEdit">CDashboard</div>
<CDashboard></CDashboard>

View File

@@ -624,7 +624,7 @@ export default defineComponent({
return '[---]'
else
return globalStore.getArrStrByValueBinary(col, val)
} else if (col.fieldtype === costanti.FieldType.select) {
} else if ((col.fieldtype === costanti.FieldType.select) || (col.fieldtype === costanti.FieldType.option)) {
if (val === undefined)
return '[---]'
else

View File

@@ -676,6 +676,31 @@
</div>
<div v-else>(Scegli)</div>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.multioption">
<q-option-group
v-model="myvalue"
:inline="col.inline"
:type="col.typeobj"
:label="col.label ? col.label : $t(col.label_trans)"
@update:model-value="changevalRec"
:options="globalStore.getTableJoinLabelValueByName(col)"
></q-option-group>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.option">
<q-option-group
v-model="myvalue"
type="toggle"
@update:model-value="changevalRec"
:options="
globalStore.getTableJoinByName(
col.jointable,
col.addall,
col.addnone,
col.filter
)
"
></q-option-group>
</div>
<div
v-else-if="
col.fieldtype === costanti.FieldType.select ||
@@ -754,6 +779,7 @@
col.fieldtype === costanti.FieldType.multiselect_by_server
"
>
myvalue: {{myvalue}}
<CMySelect
:type_out="col.field_outtype"
:col="col"

View File

@@ -25,6 +25,11 @@ export default defineComponent({
required: false,
default: null,
},
editOn: {
type: Boolean,
required: false,
default: false,
}
},
setup(props, { emit }) {

View File

@@ -56,7 +56,7 @@
</q-item-label>
</q-item-section>
<q-item-section side v-if="tools.canModifyThisRec(myrec)">
<q-item-section side v-if="tools.canModifyThisRec(myrec) || editOn">
<q-item-label>
<q-btn rounded icon="fas fa-pencil-alt">
<q-menu>

View File

@@ -272,6 +272,7 @@ export default defineComponent({
if (myvalue.value && JSON.stringify(myvalue.value)) {
saveLastOpt(props.optval, JSON.stringify(myvalue.value))
}
saveOptInCookie([myvalue.value])
emit('update:value', myvalue.value)
emit('changeval', myvalue.value)
@@ -388,6 +389,8 @@ export default defineComponent({
rec = arrtempOpt.value.find((myrec: any) => val === (myrec[`${props.optval}`]))
if (rec) {
myarrvalue.value.push(rec[`${props.optval}`])
} else {
myarrvalue.value.push(val)
}
}
} else {

View File

@@ -1,6 +1,7 @@
<template>
<div class="text-center">
<div v-if="multiselect_by_server">
myarrvalue: {{myarrvalue}}
<q-select
:model-value="myarrvalue"
@update:model-value="changeval"

View File

@@ -28,18 +28,7 @@ export default defineComponent({
const globalStore = useGlobalStore()
function initprompt() {
window.addEventListener('beforeinstallprompt', (event) => {
// console.log('******************************** beforeinstallprompt fired')
event.preventDefault()
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
// #Todo++ IMPOSTA DEFERRED PROMPT
return false
})
}
function created() {
initprompt()
animare.value = process.env.DEV ? 0 : 8000
}

View File

@@ -0,0 +1,29 @@
import { tools } from '@store/Modules/tools'
import { computed, defineComponent, reactive, ref, watch } from 'vue'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { DefaultProfile, useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
import { static_data } from '@/db/static_data'
import { useGlobalStore } from '@store/globalStore'
export default defineComponent({
name: 'CRegistration',
components: { },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const userStore = useUserStore()
const globalStore = useGlobalStore()
const $route = useRoute()
const $router = useRouter()
const site = ref(globalStore.site)
return {
tools,
site,
}
},
})

View File

@@ -0,0 +1,39 @@
<template>
<div>
<div
v-if="site.confpages.enableReg && site.confpages.enableRegByBot"
style="margin-top: 10px; text-align: center"
>
Se non sei ancora Registrato:<br />
<q-btn
type="a"
rounded
size="md"
color="primary"
href="/bot"
:label="$t('reg.submit')"
>
</q-btn>
</div>
<div
v-else-if="site.confpages.enableReg"
style="margin-top: 10px; text-align: center"
>
Se non sei ancora Registrato:<br />
<q-btn
rounded
size="md"
color="primary"
to="/signup"
:label="$t('reg.submit')"
>
</q-btn>
</div>
</div>
</template>
<script lang="ts" src="./CRegistration.ts">
</script>
<style lang="scss" scoped>
@import './CRegistration.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CRegistration} from './CRegistration.vue'