Table MySkills

This commit is contained in:
Paolo Arena
2021-10-08 00:38:22 +02:00
parent eb4156fc89
commit 48128235f8
22 changed files with 1250 additions and 1184 deletions

View File

@@ -23,33 +23,33 @@
"generate-sw": "workbox generateSW workbox-config.js" "generate-sw": "workbox generateSW workbox-config.js"
}, },
"dependencies": { "dependencies": {
"@quasar/extras": "^1.11.0", "@quasar/extras": "^1.11.1",
"@quasar/quasar-ui-qcalendar": "^4.0.0-beta.6", "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.6",
"@vue/compat": "^3.2.12", "@vue/compat": "^3.2.19",
"@vue/compiler-sfc": "^3.2.12", "@vue/compiler-sfc": "^3.2.19",
"@vue/eslint-config-standard": "^6.1.0", "@vue/eslint-config-standard": "^6.1.0",
"@vuelidate/core": "^2.0.0-alpha.26", "@vuelidate/core": "^2.0.0-alpha.27",
"@vuelidate/validators": "^2.0.0-alpha.22", "@vuelidate/validators": "^2.0.0-alpha.23",
"acorn": "^8.5.0", "acorn": "^8.5.0",
"autoprefixer": "^10.3.4", "autoprefixer": "^10.3.7",
"axios": "^0.21.4", "axios": "0.21.4",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"core-js": "^3.17.3", "core-js": "^3.18.2",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"date-fns": "^2.24.0", "date-fns": "^2.25.0",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"eslint-plugin-quasar": "^1.0.0", "eslint-plugin-quasar": "^1.0.0",
"graphql": "^15.5.3", "graphql": "^15.6.1",
"graphql-tag": "^2.12.5", "graphql-tag": "^2.12.5",
"gsap": "^3.7.1", "gsap": "^3.8.0",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"localforage": "^1.10.0", "localforage": "^1.10.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"npm": "^7.24.0", "npm": "^7.24.2",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.0.0-rc.9", "pinia": "^2.0.0-rc.11",
"prerender-spa-plugin": "^3.4.0", "prerender-spa-plugin": "^3.4.0",
"quasar": "^2.1.0", "quasar": "^2.1.0",
"quasar-extras": "^2.0.9", "quasar-extras": "^2.0.9",
@@ -58,7 +58,7 @@
"vue": "^3.2.12", "vue": "^3.2.12",
"vue-class-component": "^8.0.0-rc.1", "vue-class-component": "^8.0.0-rc.1",
"vue-country-code": "^1.1.2", "vue-country-code": "^1.1.2",
"vue-i18n": "^9.1.7", "vue-i18n": "^9.1.8",
"vue-idb": "^0.2.0", "vue-idb": "^0.2.0",
"vue-loader": "^16.5.0", "vue-loader": "^16.5.0",
"vue-property-decorator": "^10.0.0-rc.3", "vue-property-decorator": "^10.0.0-rc.3",
@@ -73,46 +73,46 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.15.7", "@babel/eslint-parser": "^7.15.7",
"@quasar/app": "^3.1.0", "@quasar/app": "^3.1.2",
"@quasar/quasar-app-extension-qcalendar": "^4.0.0-beta.6", "@quasar/quasar-app-extension-qcalendar": "^4.0.0-beta.6",
"@types/bcryptjs": "^2.4.2", "@types/bcryptjs": "^2.4.2",
"@types/dotenv": "^8.2.0", "@types/dotenv": "^8.2.0",
"@types/googlemaps": "^3.43.3", "@types/googlemaps": "^3.43.3",
"@types/jest": "^27.0.1", "@types/jest": "^27.0.2",
"@types/js-cookie": "^2.2.7", "@types/js-cookie": "^3.0.0",
"@types/node": "^14.14.45", "@types/node": "14.14.45",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/vue-tel-input": "^2.1.2", "@types/vue-tel-input": "^2.1.2",
"@types/vuelidate": "^0.7.15", "@types/vuelidate": "^0.7.15",
"@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.31.1", "@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2", "eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0", "eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.18.0", "eslint-plugin-vue": "^7.19.1",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2", "html-webpack-plugin": "^5.3.2",
"http-proxy-middleware": "^2.0.1", "http-proxy-middleware": "^2.0.1",
"jest": "^27.2.0", "jest": "^27.2.4",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
"node-sass": "^6.0.1", "node-sass": "^6.0.1",
"npm-check-updates": "^11.8.5", "npm-check-updates": "^11.8.5",
"optimize-css-assets-webpack-plugin": "^6.0.1", "optimize-css-assets-webpack-plugin": "^6.0.1",
"postcss": "^8.3.6", "postcss": "^8.3.9",
"postcss-loader": "^6.1.1", "postcss-loader": "^6.1.1",
"sass-loader": "^12.1.0", "sass-loader": "^12.1.0",
"strip-ansi": "=7.0.1", "strip-ansi": "=7.0.1",
"ts-jest": "^27.0.5", "ts-jest": "^27.0.5",
"ts-loader": "^9.2.5", "ts-loader": "^9.2.6",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-standard": "^9.0.0", "tslint-config-standard": "^9.0.0",
"tslint-loader": "^3.5.4", "tslint-loader": "^3.5.4",
"typescript": "^4.4.3", "typescript": "^4.4.3",
"vue-cli-plugin-element-ui": "^1.1.4", "vue-cli-plugin-element-ui": "^1.1.4",
"vueify": "^9.4.1", "vueify": "^9.4.1",
"workbox-webpack-plugin": "^6.0.0" "workbox-webpack-plugin": "^6.3.0"
}, },
"browser": { "browser": {
"crypto": false "crypto": false

View File

@@ -2,7 +2,7 @@ body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: #a7a7a7; color: #373737;
line-height: 1.5; line-height: 1.5;
//font-size: 1rem; //font-size: 1rem;
} }

View File

@@ -55,11 +55,18 @@ export default defineComponent({
function refreshval() { function refreshval() {
myarrvalues.value = [] myarrvalues.value = []
// console.table(options) // console.log('options', props.options)
if (props.options) { if (props.options) {
props.options.forEach((rec: any, index) => { props.options.forEach((rec: any, index) => {
if (props.type === costanti.FieldType.multiselect) { if (props.type === costanti.FieldType.multiselect) {
if (!!myval.value) { if (!!myval.value) {
/*
console.log('rec', rec)
console.log('optval', props.optval)
console.log('optlab', props.optlab)
console.log('myval.value', myval.value)
console.log('rec[props.optval]', rec[props.optval])
*/
// @ts-ignore // @ts-ignore
if (myval.value.includes(rec[props.optval])) { if (myval.value.includes(rec[props.optval])) {
const mydata: any = { const mydata: any = {
@@ -71,6 +78,18 @@ export default defineComponent({
color: tools.getColorByIndexBest(index) color: tools.getColorByIndexBest(index)
} }
if (rec['color']) {
mydata.color = rec['color']
}
/*
if (rec['theme']) {
mydata.class = rec['theme']
}
*/
// console.log('mydata', mydata)
if (tools.isObject(props.optlab)) { if (tools.isObject(props.optlab)) {
// @ts-ignore // @ts-ignore
mydata.label = props.options.filter((myrec: any) => myrec[props.optval] === mydata.value).map(props.optlab) mydata.label = props.options.filter((myrec: any) => myrec[props.optval] === mydata.value).map(props.optlab)
@@ -80,6 +99,8 @@ export default defineComponent({
mydata.label = rec[props.optlab] mydata.label = rec[props.optlab]
} }
// console.log('mydata.label', mydata.label)
if (props.opticon) if (props.opticon)
mydata.icon = rec[props.opticon] mydata.icon = rec[props.opticon]
if (props.optcolor) if (props.optcolor)

View File

@@ -32,6 +32,16 @@ export default defineComponent({
required: false, required: false,
default: '', default: '',
}, },
indrec: {
type: Number,
required: false,
default: -1,
},
mysubsubkey: {
type: String,
required: false,
default: '',
},
type: { type: {
type: Number, type: Number,
required: true, required: true,
@@ -183,7 +193,7 @@ export default defineComponent({
function savefield(value: any, initialval: any, myq: any) { function savefield(value: any, initialval: any, myq: any) {
myvalue.value = value myvalue.value = value
setValDb(myq, props.mykey, myvalue.value, props.type, props.serv, props.table, props.mysubkey, props.id) setValDb(myq, props.mykey, myvalue.value, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey)
} }
function savefieldboolean(value: any) { function savefieldboolean(value: any) {
@@ -192,7 +202,7 @@ export default defineComponent({
else else
myvalue.value = value myvalue.value = value
setValDb($q, props.mykey, myvalue, props.type, props.serv, props.table, props.mysubkey, props.id) setValDb($q, props.mykey, myvalue, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey)
} }
function selectcountry({ name, iso2, dialCode }: { name: string, iso2: string, dialCode: string }) { function selectcountry({ name, iso2, dialCode }: { name: string, iso2: string, dialCode: string }) {

View File

@@ -122,7 +122,7 @@ export default defineComponent({
function mounted() { function mounted() {
// console.log('mounted') // console.log('mounted')
if ((props.subfield !== '') && (props.subfield !== '')) { if (props.subfield !== '') {
if (props.row[props.field] === undefined) { if (props.row[props.field] === undefined) {
myrow.value[props.field] = {} myrow.value[props.field] = {}
myvalue.value = '' myvalue.value = ''

View File

@@ -114,18 +114,19 @@
<CMyChipList <CMyChipList
@update:model-value="changevalRec" @update:model-value="changevalRec"
:type="costanti.FieldType.multiselect" :type="costanti.FieldType.multiselect"
:value="myvalue" v-model:value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable)"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.select"> <div v-else-if="col.fieldtype === costanti.FieldType.select">
myvalue: {{ myvalue }}
<CMyChipList <CMyChipList
@update:model-value="changevalRec" @update:model-value="changevalRec"
myclass="text-center" myclass="text-center"
:type="costanti.FieldType.select" :type="costanti.FieldType.select"
:value="myvalue" v-model:value="myvalue"
:options="globalStore.getTableJoinByName(col.jointable)" :options="globalStore.getTableJoinByName(col.jointable)"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
@@ -133,7 +134,8 @@
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.boolean"> <div v-else-if="col.fieldtype === costanti.FieldType.boolean">
<q-toggle <q-toggle
dark color="green" v-model="myvalue" :label="col.title" dark color="green"
v-model:value="myvalue" :label="col.title"
:disable="disable && col.name !== 'profile.saw_zoom_presentation'" :disable="disable && col.name !== 'profile.saw_zoom_presentation'"
@update:model-value="changevalRec"></q-toggle> @update:model-value="changevalRec"></q-toggle>
</div> </div>
@@ -319,7 +321,7 @@
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.select"> <div v-else-if="col.fieldtype === costanti.FieldType.select">
<CMySelect <CMySelect
:label="col.title" :label="col.label"
v-model:value="scope.value" v-model:value="scope.value"
:optval="fieldsTable.getKeyByTable(col.jointable)" :optval="fieldsTable.getKeyByTable(col.jointable)"
:optlab="fieldsTable.getLabelByTable(col.jointable)" :optlab="fieldsTable.getLabelByTable(col.jointable)"
@@ -369,7 +371,6 @@
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect"> <div v-else-if="col.fieldtype === costanti.FieldType.multiselect">
<div>join: {{ col.jointable }}</div>
<q-select <q-select
v-model="scope.value" v-model="scope.value"
@@ -385,7 +386,7 @@
:option-label="fieldsTable.getLabelByTable(col.jointable)" :option-label="fieldsTable.getLabelByTable(col.jointable)"
:option-value="fieldsTable.getKeyByTable(col.jointable)" :option-value="fieldsTable.getKeyByTable(col.jointable)"
style="min-width: 150px" style="min-width: 150px"
@update:model-value="changeCol"> @update:model-value="changeval">
</q-select> </q-select>
</div> </div>

View File

@@ -11,7 +11,7 @@ export default defineComponent({
type: Array, type: Array,
required: true, required: true,
}, },
value: [String, Number, Array], value: [String, Number],
label: { label: {
type: String, type: String,
required: true, required: true,
@@ -57,7 +57,7 @@ export default defineComponent({
const userStore = useUserStore() const userStore = useUserStore()
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const myvalue = ref('') const myvalue = ref(<string | number>'')
function changeval(newval: any) { function changeval(newval: any) {
console.log('changeval', newval) console.log('changeval', newval)
@@ -67,21 +67,29 @@ export default defineComponent({
} }
function mounted() { function mounted() {
console.log('mounted', mounted)
if (props.options) { if (props.options) {
const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value) const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value)
// console.log('rec', rec) /*
if (!props.useinput) { console.log('rec', rec, 'props.useinput', props.useinput)
if (props.value) { console.log('props.value', props.value)
myvalue.value = props.value.toString() console.log('options', props.options)
} console.log('optval', props.optval)
} else { console.log('optlab', props.optlab)
if (rec) { */
if (props.funcgetvaluebyid)
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
else
myvalue.value = rec[`${props.optlab}`]
// console.log('myvalue', myvalue, 'optval', optval, 'rec', rec[`${optval}`]) if (rec) {
if (props.funcgetvaluebyid)
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
else
myvalue.value = rec[`${props.optlab}`]
// console.log('myvalue', myvalue, 'optval', optval, 'rec', rec[`${optval}`])
} else {
if (!props.useinput) {
if (props.value) {
myvalue.value = props.value
}
} }
} }
} }

View File

@@ -0,0 +1,29 @@
.cltitlebg{
}
.titletext {
color: white;
font-size: 3rem;
font-weight: 500;
line-height: 3rem;
text-shadow: .25rem .25rem .5rem black;
letter-spacing: .00937em;
opacity: 0.9;
}
@media (max-width: 718px) {
// PER VERSIONE MOBILE
.titletext {
color: white;
font-size: 2rem;
font-weight: 500;
line-height: 2rem;
text-shadow: .25rem .25rem .5rem black;
}
}
.q-img__content > div{
background: rgba(0,0,0,0.17) !important;
}

56
src/components/CSkill/CSkill.ts Executable file
View File

@@ -0,0 +1,56 @@
import {
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
} from 'vue'
import { tools } from '@store/Modules/tools'
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { costanti } from '@costanti'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
import { colmySkills } from '@store/Modules/fieldsTable'
import { CGridTableRec } from '@/components/CGridTableRec'
export default defineComponent({
name: 'CSkill',
props: {
defaultnewrec: {
type: Function,
required: false,
},
},
components: {
CMyFieldDb, CGridTableRec,
},
setup(props, { attrs, slots, emit }) {
const mytable = 'users'
const globalStore = useGlobalStore()
const userStore = useUserStore()
async function createNewRecordInUserTable() {
console.log('createNewRecordInUserTable')
let mydata = {
table: mytable,
data: {
userId: userStore.my._id,
data: {},
field: 'myskills'
}
};
if (props.defaultnewrec) {
mydata.data.data = props.defaultnewrec
}
console.log('mydata', mydata)
const data = await globalStore.saveSubRec(mydata)
}
return {
tools,
costanti,
colmySkills,
}
},
})

View File

@@ -0,0 +1,46 @@
<template>
<div>
Competenze:<br>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CGridTableRec
prop_mytable="myskills"
prop_mytitle="Mie Competenze"
:prop_mycolumns="colmySkills"
prop_colkey="idSkill"
nodataLabel="Nessuna Competenza inserita"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
</CGridTableRec>
</div>
<div class="row">
<!--
<q-btn
flat dense color="primary"
:label="$t('grid.addrecord')"
@click="createNewRecordInUserTable">
</q-btn>
<CMyFieldDb
title="Competenza"
table="users"
mykey="profile"
mysubkey="myskills"
indrec=0
mysubsubkey="idSkill"
:type="costanti.FieldType.binary">
</CMyFieldDb>
-->
</div>
</div>
Servizi:<br>
</template>
<script lang="ts" src="./CSkill.ts">
</script>
<style lang="scss" scoped>
@import './CSkill.scss';
</style>

1
src/components/CSkill/index.ts Executable file
View File

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

View File

@@ -9,6 +9,8 @@ const msg_website_it = {
quantityAvailable: 'Disponibili', quantityAvailable: 'Disponibili',
weight: 'Peso', weight: 'Peso',
stars: 'Voto', stars: 'Voto',
color: 'Colore',
theme: 'Tema',
}, },
hours: { hours: {
descr: 'Descrizione', descr: 'Descrizione',

View File

@@ -27,24 +27,24 @@ export default function () {
return fieldsTable return fieldsTable
} }
function getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: any, id?: any, idmain?: any) { function getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: any, id?: any, idmain?: any, indrec?: number, subsubkey?: string) {
// console.log('getValDb') // console.log('getValDb')
return toolsext.getValDb(keystr, serv, def, table, subkey, id, idmain) return toolsext.getValDb(keystr, serv, def, table, subkey, id, idmain, indrec, subsubkey)
} }
function getValDbLang(keystr: string, serv: boolean, def?: any, table?: string, subkey?: any) { function getValDbLang(keystr: string, serv: boolean, def?: any, table?: string, subkey?: any, indrec?: number, subsubkey?: string) {
let ris = toolsext.getValDb(`${keystr}_${toolsext.getLocale()}`, serv, def, table, subkey) let ris = toolsext.getValDb(`${keystr}_${toolsext.getLocale()}`, serv, def, table, subkey, indrec, subsubkey)
if (ris === def) ris = toolsext.getValDb(`${keystr}_it`, serv, def, table, subkey) if (ris === def) ris = toolsext.getValDb(`${keystr}_it`, serv, def, table, subkey)
return ris return ris
} }
async function setValDb($q: any, key: string, value: any, type: any, serv: boolean, table?: string, subkey?: string, id?: any) { async function setValDb($q: any, key: string, value: any, type: any, serv: boolean, table?: string, subkey?: string, id?: any, indrec?: number, subsubkey?: string) {
const userStore = useUserStore() const userStore = useUserStore()
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const { t } = useI18n() const { t } = useI18n()
console.log('setValDb', key, value, serv, table, subkey) console.log('setValDb', key, value, serv, table, subkey, indrec, subsubkey, indrec, subsubkey)
let mydatatosave: IDataPass | null = null let mydatatosave: IDataPass | null = null
if (table === 'users') { if (table === 'users') {
@@ -53,8 +53,14 @@ export default function () {
const myfield: any = {} const myfield: any = {}
if (key === 'profile') { if (key === 'profile') {
// @ts-ignore
userStore.my.profile[subkey] = value if (subsubkey && indrec) {
// @ts-ignore
userStore.my.profile[subkey][indrec][subsubkey] = value
}else {
// @ts-ignore
userStore.my.profile[subkey] = value
}
} else { } else {
// @ts-ignore // @ts-ignore
userStore.my[key] = value userStore.my[key] = value

View File

@@ -240,6 +240,7 @@ export interface IGlobalState {
URL_RESTORE: string URL_RESTORE: string
levels: ILevel[], levels: ILevel[],
skills: ISkill[], skills: ISkill[],
statusSkills: IStatusSkill[],
sectors: ISector[], sectors: ISector[],
} }
@@ -533,20 +534,45 @@ export interface IPagination {
} }
export interface ISkill { export interface ISkill {
_id: number
descr: string descr: string
idSector: string idSector: number[]
icon?: string icon?: string
img?: string img?: string
} }
export interface IStatusSkill {
_id: number
descr: string
color: string
theme: string
}
export interface ISector { export interface ISector {
_id: number
descr: string descr: string
idSector?: number
icon?: string icon?: string
img?: string img?: string
color: string
theme: string
} }
export interface ILevel { export interface ILevel {
_id: string _id: number
descr: string descr: string
color: string
theme: string
years_of_exp: number years_of_exp: number
} }
export interface IMySkill {
_id: number
idSkill: number
idStatusSkill: number[]
NumLevel: number
note: string
date_created?: Date,
date_updated?: Date,
}

View File

@@ -4,10 +4,12 @@ import {
} from 'vue' } from 'vue'
import { tools } from '@src/store/Modules/tools' import { tools } from '@src/store/Modules/tools'
import { CSkill } from '@/components/CSkill'
export default defineComponent({ export default defineComponent({
name: 'Home', name: 'Home',
components: { CSkill },
setup() { setup() {
return { return {

View File

@@ -2,6 +2,9 @@
<q-page class=""> <q-page class="">
<h1>Inizio:</h1> <h1>Inizio:</h1>
<CSkill>
</CSkill>
</q-page> </q-page>

View File

@@ -1,8 +1,17 @@
// @ts-ignore declare module '@vue-leaflet/vue-leaflet' {
import { LMap, LIcon, LTileLayer, LMarker, LControlLayers, LTooltip, LPopup, LPolyline, LPolygon, LRectangle, } from '@vue-leaflet/vue-leaflet' import type { DefineComponent } from 'vue';
export const LMap: DefineComponent;
import 'leaflet/dist/leaflet.css' export const LIcon: DefineComponent;
export const LTileLayer: DefineComponent;
export const LMarker: DefineComponent;
export const LControlLayers: DefineComponent;
export const LTooltip: DefineComponent;
export const LPopup: DefineComponent;
export const LPolyline: DefineComponent;
export const LPolygon: DefineComponent;
export const LRectangle: DefineComponent;
}
import { import {
defineComponent, ref, computed, defineComponent, ref, computed,
@@ -10,20 +19,6 @@ import {
import { tools } from '@src/store/Modules/tools' import { tools } from '@src/store/Modules/tools'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const leaflet = require('leaflet');
delete leaflet.Icon.Default.prototype._getIconUrl;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const iconRetinaUrl = require('leaflet/dist/images/marker-icon-2x.png');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const iconUrl = require('leaflet/dist/images/marker-icon.png');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const shadowUrl = require('leaflet/dist/images/marker-shadow.png');
leaflet.Icon.Default.mergeOptions({ iconRetinaUrl, iconUrl, shadowUrl })
export default defineComponent({ export default defineComponent({
name: 'Home', name: 'Home',
components: { components: {

View File

@@ -761,7 +761,16 @@ const msg_it = {
telegram_key: 'Chiave Bot Telegram', telegram_key: 'Chiave Bot Telegram',
telegram_bot_name: 'Telegram BotName', telegram_bot_name: 'Telegram BotName',
pathreg_add: 'Suffisso', pathreg_add: 'Suffisso',
} },
skill: {
name: 'Competenza',
},
level: {
name: 'Livello',
},
statusSkill: {
name: 'Stato',
},
}, },
}; };

View File

@@ -267,31 +267,96 @@ export const colTableStorehouse = [
] ]
export const colSectors = [ export const colSectors = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }), AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colLevels = [
AddCol({ name: '_id', label_trans: 'index' }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'years_of_exp', label_trans: 'years_of_exp', fieldtype: costanti.FieldType.number }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colSkills = [
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol({ AddCol({
name: 'idSector', name: 'idSector',
label_trans: 'sectors.name', label_trans: 'sectors.name',
fieldtype: costanti.FieldType.select, fieldtype: costanti.FieldType.select,
jointable: 'sectors', jointable: 'sectors',
}), }),
AddCol({ name: 'main', label_trans: 'store.main', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colLevels = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'years_of_exp', label_trans: 'years_of_exp', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colCitys = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'comune', label_trans: 'city.comune' }),
AddCol({ name: 'prov', label_trans: 'city.prov' }),
AddCol({ name: 'reg', label_trans: 'city.reg' }),
AddCol({ name: 'pref', label_trans: 'city.pref' }),
AddCol({ name: 'cap', label_trans: 'city.cap' }),
AddCol({ name: 'abitanti', label_trans: 'city.abitanti', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'country', label_trans: 'city.country' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colSkills = [
// AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'img', label_trans: 'store.img' }),
AddCol({ name: 'icon', label_trans: 'store.icon' }),
AddCol({
name: 'idSector',
label_trans: 'sectors.name',
fieldtype: costanti.FieldType.multiselect,
jointable: 'sectors',
}),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colmySkills = [
//AddCol({
// name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
//}),
AddCol({
name: 'idSkill',
label_trans: 'skill.name',
fieldtype: costanti.FieldType.select,
jointable: 'skills',
}),
AddCol({
name: 'numLevel',
label_trans: 'level.name',
fieldtype: costanti.FieldType.select,
jointable: 'levels',
}),
AddCol({
name: 'idStatusSkill',
label_trans: 'statusSkill.name',
fieldtype: costanti.FieldType.multiselect,
jointable: 'statusSkills',
}),
AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colStatusSkills = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descr', label_trans: 'store.description' }),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'theme', label_trans: 'products.theme' }),
AddCol(DeleteRec), AddCol(DeleteRec),
AddCol(DuplicateRec), AddCol(DuplicateRec),
] ]
@@ -1353,6 +1418,13 @@ export const fieldsTable = {
colkey: 'key', colkey: 'key',
collabel: 'key', collabel: 'key',
}, },
{
value: 'myskills',
label: 'Mie Competenze',
columns: colmySkills,
colkey: '_id',
collabel: (rec: any) => `${rec.name} ${rec.surname}`,
},
{ {
value: 'skills', value: 'skills',
label: 'Competenze', label: 'Competenze',
@@ -1360,6 +1432,13 @@ export const fieldsTable = {
colkey: '_id', colkey: '_id',
collabel: 'descr', collabel: 'descr',
}, },
{
value: 'statusSkills',
label: 'Stato Attuale',
columns: colStatusSkills,
colkey: '_id',
collabel: 'descr',
},
{ {
value: 'sectors', value: 'sectors',
label: 'Settori', label: 'Settori',
@@ -1374,6 +1453,13 @@ export const fieldsTable = {
colkey: '_id', colkey: '_id',
collabel: 'descr', collabel: 'descr',
}, },
{
value: 'citys',
label: 'Città',
columns: colCitys,
colkey: '_id',
collabel: 'comune',
},
], ],
} }

View File

@@ -134,7 +134,7 @@ export const toolsext = {
// this.$q.lang.set(mylang) // this.$q.lang.set(mylang)
}, },
getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: string, id?: any, idmain?: any): any | undefined { getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: string, id?: any, idmain?: any, indrec?: number, subsubkey?: string): any | undefined {
const todos = useTodoStore() const todos = useTodoStore()
const userStore = useUserStore() const userStore = useUserStore()
@@ -143,8 +143,13 @@ export const toolsext = {
if (keystr === 'profile') { if (keystr === 'profile') {
if (subkey) { if (subkey) {
// console.log('userStore.my.profile', userStore.my.profile, 'subkey', subkey, ) // console.log('userStore.my.profile', userStore.my.profile, 'subkey', subkey, )
// @ts-ignore if (subsubkey && indrec) {
return userStore.my.profile[subkey] // @ts-ignore
return userStore.my.profile[subkey][indrec][subsubkey]
} else {
// @ts-ignore
return userStore.my.profile[subkey]
}
} }
} else if (keystr) { // @ts-ignore } else if (keystr) { // @ts-ignore
// @ts-ignore // @ts-ignore

View File

@@ -118,6 +118,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
URL_RESTORE: '', URL_RESTORE: '',
levels: [], levels: [],
skills: [], skills: [],
statusSkills: [],
sectors: [], sectors: [],
}), }),
@@ -224,6 +225,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
return state.levels return state.levels
else if (table === 'skills') else if (table === 'skills')
return state.skills return state.skills
else if (table === 'statusSkills')
return state.statusSkills
else if (table === 'sectors') else if (table === 'sectors')
return state.sectors return state.sectors
else return ris else return ris
@@ -759,6 +762,19 @@ export const useGlobalStore = defineStore('GlobalStore', {
}) })
}, },
async saveSubRec(mydata: any) {
// console.log('saveTable', mydata)
const userStore = useUserStore()
return Api.SendReq('/setsubrec', 'POST', mydata)
.then((res) => res.data)
.catch((error) => {
console.log('error saveSubRec', error)
userStore.setErrorCatch(error)
return null
})
},
async saveFieldValue(mydata: IDataToSet) { async saveFieldValue(mydata: IDataToSet) {
// const userStore = useUserStore() // const userStore = useUserStore()
return Api.SendReq('/chval', 'PATCH', { data: mydata }) return Api.SendReq('/chval', 'PATCH', { data: mydata })
@@ -1110,6 +1126,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.departments = (res.data.departments) ? [...res.data.departments] : [] this.departments = (res.data.departments) ? [...res.data.departments] : []
this.levels = (res.data.levels) ? [...res.data.levels] : [] this.levels = (res.data.levels) ? [...res.data.levels] : []
this.skills = (res.data.skills) ? [...res.data.skills] : [] this.skills = (res.data.skills) ? [...res.data.skills] : []
this.statusSkills = (res.data.statusSkills) ? [...res.data.statusSkills] : []
this.sectors = (res.data.sectors) ? [...res.data.sectors] : [] this.sectors = (res.data.sectors) ? [...res.data.sectors] : []
// console.log('res.data.cart', res.data.cart) // console.log('res.data.cart', res.data.cart)

1911
yarn.lock

File diff suppressed because it is too large Load Diff