PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
0
src/components/CViewTable/CViewTable.scss
Executable file
0
src/components/CViewTable/CViewTable.scss
Executable file
61
src/components/CViewTable/CViewTable.ts
Executable file
61
src/components/CViewTable/CViewTable.ts
Executable file
@@ -0,0 +1,61 @@
|
||||
import type {
|
||||
PropType} from 'vue';
|
||||
import {
|
||||
computed,
|
||||
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@tools'
|
||||
import type { IOptQueryGM } from '@src/model';
|
||||
import { IOptCatalogo, IMyScheda, IProduct, ISchedaSingola, IText } from '@src/model'
|
||||
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CViewTable',
|
||||
props: {
|
||||
options: {
|
||||
type: Object as PropType<IOptQueryGM>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const risultatoHTML = ref('')
|
||||
const tabella = ref('')
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
async function mounted() {
|
||||
if (props.options) {
|
||||
loading.value = true
|
||||
await getTabellaDaGM()
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function getTabellaDaGM() {
|
||||
tabella.value = props.options.nameTable
|
||||
risultatoHTML.value = ''
|
||||
risultatoHTML.value = await globalStore.getGM_Tabella(props.options)
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
return {
|
||||
tools,
|
||||
globalStore,
|
||||
costanti,
|
||||
getTabellaDaGM,
|
||||
risultatoHTML,
|
||||
tabella,
|
||||
loading,
|
||||
}
|
||||
},
|
||||
})
|
||||
23
src/components/CViewTable/CViewTable.vue
Executable file
23
src/components/CViewTable/CViewTable.vue
Executable file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<q-inner-loading id="spinner" :showing="loading">
|
||||
<q-spinner-tail color="primary" size="4em"> </q-spinner-tail>
|
||||
</q-inner-loading>
|
||||
<div v-if="options">
|
||||
<div class="text-center text-bold text-h6 text-blue">
|
||||
Tabella: {{ options.nameTable }}<br>
|
||||
</div>
|
||||
<div class="text-center text-h7">
|
||||
Query: {{ options.where }}<br>
|
||||
</div>
|
||||
risultatoHTML: {{risultatoHTML}}
|
||||
<br><br>
|
||||
<div v-html="risultatoHTML">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CViewTable.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CViewTable.scss';
|
||||
</style>
|
||||
1
src/components/CViewTable/index.ts
Executable file
1
src/components/CViewTable/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CViewTable } from './CViewTable.vue'
|
||||
Reference in New Issue
Block a user