PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { CDownloadJsonFile } from '@/components/CDownloadJsonFile'
|
||||
import { CDownloadJsonFile } from '@src/components/CDownloadJsonFile'
|
||||
import { PropType, defineComponent, onMounted, ref } from 'vue'
|
||||
import { IMyPage } from '@src/model'
|
||||
import type { IMyPage } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CExportImportPage',
|
||||
@@ -13,27 +13,27 @@ export default defineComponent({
|
||||
idPage: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
esporta: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
nomefile: {
|
||||
},
|
||||
nomefileprop: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
components: {CDownloadJsonFile},
|
||||
components: { CDownloadJsonFile },
|
||||
setup(props) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const myrec = ref(<IMyPage | undefined>{})
|
||||
|
||||
|
||||
const nomefile = ref(<string>'')
|
||||
const testoJson = ref(<any>'')
|
||||
let fileContent = ref('')
|
||||
const fileContent = ref('')
|
||||
|
||||
const ris = ref('')
|
||||
|
||||
@@ -49,14 +49,14 @@ export default defineComponent({
|
||||
tools.showNotif($q, 'Seleziona un file JSON valido.', { color: 'negative', icon: 'notifications' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const importaPagina = async () => {
|
||||
try {
|
||||
if (!fileContent.value) {
|
||||
tools.showNotif($q, 'Nessun file JSON caricato.', { color: 'negative', icon: 'notifications' })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Chiama la funzione di importazione passandole il contenuto del file
|
||||
ris.value = await globalStore.importPage(fileContent.value, $q, t);
|
||||
|
||||
@@ -68,15 +68,15 @@ export default defineComponent({
|
||||
async function esportaPagina() {
|
||||
|
||||
if (myrec.value) {
|
||||
testoJson.value = await globalStore.exportPage(myrec.value.path!, $q, t)
|
||||
testoJson.value = await globalStore.exportPage(myrec.value.path, $q, t)
|
||||
}
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
nomefile.value = props.nomefile
|
||||
nomefile.value = props.nomefileprop
|
||||
|
||||
myrec.value = globalStore.getPageById(props.idPage)
|
||||
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
@@ -90,6 +90,7 @@ export default defineComponent({
|
||||
nomefile,
|
||||
onFileChange,
|
||||
ris,
|
||||
fileContent,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user