Files
myprojplanet_vite/src/components/CMyRecCircuitCard/CMyRecCircuitCard.ts
Surya Paolo bc960d38a1 PASSAGGIO A VITE !
AGG. 1.1.23
2025-03-01 14:14:43 +01:00

93 lines
2.2 KiB
TypeScript
Executable File

import type { PropType } from 'vue';
import { defineComponent, onMounted, ref, watch } from 'vue'
import { useCircuitStore } from '@store/CircuitStore'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
import { IImgGallery, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@src/common/shared_vuejs'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { tools } from '@tools'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import { CMyCardPopup } from '@src/components/CMyCardPopup'
import { CCurrencyValue } from '@src/components/CCurrencyValue'
import { useRouter } from 'vue-router'
// import { useRouter } from 'vue-router'
export default defineComponent({
name: 'CMyRecCircuitCard',
components: { CMyCardPopup, CCurrencyValue },
emits: ['setCmd', 'cmdext'],
props: {
table: {
type: String,
required: true,
},
prop_myrec: {
type: Object as PropType<any>,
required: false,
default: null,
},
},
setup(props, { emit }) {
const userStore = useUserStore()
const circuitStore = useCircuitStore()
const globalStore = useGlobalStore()
// const $q = useQuasar()
const { t } = useI18n()
// const $router = useRouter()
const circuit = ref(<any>null)
const showingtooltip = ref(false)
const $router = useRouter()
watch(() => props.prop_myrec, (newval, oldval) => {
mounted()
})
function mounted() {
if (props.prop_myrec) {
circuit.value = props.prop_myrec
}
}
function setCmd($q: any, cmd: number, myusername: string, value: any, groupname: string) {
emit('setCmd', $q, cmd, myusername, value, groupname)
}
function cmdExt(cmd: any, val1: any, val2: any) {
emit('cmdext', cmd, val1, val2)
}
function naviga(path: string) {
$router.push(path)
}
onMounted(mounted)
return {
t,
circuit,
costanti,
naviga,
setCmd,
shared_consts,
userStore,
tools,
toolsext,
fieldsTable,
cmdExt,
globalStore,
circuitStore,
showingtooltip,
}
},
})