Table MySkills
This commit is contained in:
50
package.json
50
package.json
@@ -23,33 +23,33 @@
|
||||
"generate-sw": "workbox generateSW workbox-config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@quasar/extras": "^1.11.0",
|
||||
"@quasar/extras": "^1.11.1",
|
||||
"@quasar/quasar-ui-qcalendar": "^4.0.0-beta.6",
|
||||
"@vue/compat": "^3.2.12",
|
||||
"@vue/compiler-sfc": "^3.2.12",
|
||||
"@vue/compat": "^3.2.19",
|
||||
"@vue/compiler-sfc": "^3.2.19",
|
||||
"@vue/eslint-config-standard": "^6.1.0",
|
||||
"@vuelidate/core": "^2.0.0-alpha.26",
|
||||
"@vuelidate/validators": "^2.0.0-alpha.22",
|
||||
"@vuelidate/core": "^2.0.0-alpha.27",
|
||||
"@vuelidate/validators": "^2.0.0-alpha.23",
|
||||
"acorn": "^8.5.0",
|
||||
"autoprefixer": "^10.3.4",
|
||||
"axios": "^0.21.4",
|
||||
"autoprefixer": "^10.3.7",
|
||||
"axios": "0.21.4",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"core-js": "^3.17.3",
|
||||
"core-js": "^3.18.2",
|
||||
"crypto": "^1.0.1",
|
||||
"date-fns": "^2.24.0",
|
||||
"date-fns": "^2.25.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"eslint-plugin-quasar": "^1.0.0",
|
||||
"graphql": "^15.5.3",
|
||||
"graphql": "^15.6.1",
|
||||
"graphql-tag": "^2.12.5",
|
||||
"gsap": "^3.7.1",
|
||||
"gsap": "^3.8.0",
|
||||
"jquery": "^3.6.0",
|
||||
"js-cookie": "^3.0.1",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"normalize.css": "^8.0.1",
|
||||
"npm": "^7.24.0",
|
||||
"npm": "^7.24.2",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.0.0-rc.9",
|
||||
"pinia": "^2.0.0-rc.11",
|
||||
"prerender-spa-plugin": "^3.4.0",
|
||||
"quasar": "^2.1.0",
|
||||
"quasar-extras": "^2.0.9",
|
||||
@@ -58,7 +58,7 @@
|
||||
"vue": "^3.2.12",
|
||||
"vue-class-component": "^8.0.0-rc.1",
|
||||
"vue-country-code": "^1.1.2",
|
||||
"vue-i18n": "^9.1.7",
|
||||
"vue-i18n": "^9.1.8",
|
||||
"vue-idb": "^0.2.0",
|
||||
"vue-loader": "^16.5.0",
|
||||
"vue-property-decorator": "^10.0.0-rc.3",
|
||||
@@ -73,46 +73,46 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/dotenv": "^8.2.0",
|
||||
"@types/googlemaps": "^3.43.3",
|
||||
"@types/jest": "^27.0.1",
|
||||
"@types/js-cookie": "^2.2.7",
|
||||
"@types/node": "^14.14.45",
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/js-cookie": "^3.0.0",
|
||||
"@types/node": "14.14.45",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/vue-tel-input": "^2.1.2",
|
||||
"@types/vuelidate": "^0.7.15",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.1",
|
||||
"@typescript-eslint/parser": "^4.31.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
||||
"@typescript-eslint/parser": "^4.33.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-node": "^11.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",
|
||||
"html-webpack-plugin": "^5.3.2",
|
||||
"http-proxy-middleware": "^2.0.1",
|
||||
"jest": "^27.2.0",
|
||||
"jest": "^27.2.4",
|
||||
"json-loader": "^0.5.7",
|
||||
"node-sass": "^6.0.1",
|
||||
"npm-check-updates": "^11.8.5",
|
||||
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
||||
"postcss": "^8.3.6",
|
||||
"postcss": "^8.3.9",
|
||||
"postcss-loader": "^6.1.1",
|
||||
"sass-loader": "^12.1.0",
|
||||
"strip-ansi": "=7.0.1",
|
||||
"ts-jest": "^27.0.5",
|
||||
"ts-loader": "^9.2.5",
|
||||
"ts-loader": "^9.2.6",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-standard": "^9.0.0",
|
||||
"tslint-loader": "^3.5.4",
|
||||
"typescript": "^4.4.3",
|
||||
"vue-cli-plugin-element-ui": "^1.1.4",
|
||||
"vueify": "^9.4.1",
|
||||
"workbox-webpack-plugin": "^6.0.0"
|
||||
"workbox-webpack-plugin": "^6.3.0"
|
||||
},
|
||||
"browser": {
|
||||
"crypto": false
|
||||
|
||||
@@ -2,7 +2,7 @@ body {
|
||||
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #a7a7a7;
|
||||
color: #373737;
|
||||
line-height: 1.5;
|
||||
//font-size: 1rem;
|
||||
}
|
||||
|
||||
@@ -55,11 +55,18 @@ export default defineComponent({
|
||||
function refreshval() {
|
||||
myarrvalues.value = []
|
||||
|
||||
// console.table(options)
|
||||
// console.log('options', props.options)
|
||||
if (props.options) {
|
||||
props.options.forEach((rec: any, index) => {
|
||||
if (props.type === costanti.FieldType.multiselect) {
|
||||
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
|
||||
if (myval.value.includes(rec[props.optval])) {
|
||||
const mydata: any = {
|
||||
@@ -71,6 +78,18 @@ export default defineComponent({
|
||||
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)) {
|
||||
// @ts-ignore
|
||||
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]
|
||||
}
|
||||
|
||||
// console.log('mydata.label', mydata.label)
|
||||
|
||||
if (props.opticon)
|
||||
mydata.icon = rec[props.opticon]
|
||||
if (props.optcolor)
|
||||
|
||||
@@ -32,6 +32,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
indrec: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: -1,
|
||||
},
|
||||
mysubsubkey: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
required: true,
|
||||
@@ -183,7 +193,7 @@ export default defineComponent({
|
||||
|
||||
function savefield(value: any, initialval: any, myq: any) {
|
||||
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) {
|
||||
@@ -192,7 +202,7 @@ export default defineComponent({
|
||||
else
|
||||
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 }) {
|
||||
|
||||
@@ -122,7 +122,7 @@ export default defineComponent({
|
||||
|
||||
function mounted() {
|
||||
// console.log('mounted')
|
||||
if ((props.subfield !== '') && (props.subfield !== '')) {
|
||||
if (props.subfield !== '') {
|
||||
if (props.row[props.field] === undefined) {
|
||||
myrow.value[props.field] = {}
|
||||
myvalue.value = ''
|
||||
|
||||
@@ -114,18 +114,19 @@
|
||||
<CMyChipList
|
||||
@update:model-value="changevalRec"
|
||||
:type="costanti.FieldType.multiselect"
|
||||
:value="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:options="globalStore.getTableJoinByName(col.jointable)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.select">
|
||||
myvalue: {{ myvalue }}
|
||||
<CMyChipList
|
||||
@update:model-value="changevalRec"
|
||||
myclass="text-center"
|
||||
:type="costanti.FieldType.select"
|
||||
:value="myvalue"
|
||||
v-model:value="myvalue"
|
||||
:options="globalStore.getTableJoinByName(col.jointable)"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
@@ -133,7 +134,8 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.boolean">
|
||||
<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'"
|
||||
@update:model-value="changevalRec"></q-toggle>
|
||||
</div>
|
||||
@@ -319,7 +321,7 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.select">
|
||||
<CMySelect
|
||||
:label="col.title"
|
||||
:label="col.label"
|
||||
v-model:value="scope.value"
|
||||
:optval="fieldsTable.getKeyByTable(col.jointable)"
|
||||
:optlab="fieldsTable.getLabelByTable(col.jointable)"
|
||||
@@ -369,7 +371,6 @@
|
||||
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.multiselect">
|
||||
<div>join: {{ col.jointable }}</div>
|
||||
|
||||
<q-select
|
||||
v-model="scope.value"
|
||||
@@ -385,7 +386,7 @@
|
||||
:option-label="fieldsTable.getLabelByTable(col.jointable)"
|
||||
:option-value="fieldsTable.getKeyByTable(col.jointable)"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="changeCol">
|
||||
@update:model-value="changeval">
|
||||
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@ export default defineComponent({
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
value: [String, Number, Array],
|
||||
value: [String, Number],
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -57,7 +57,7 @@ export default defineComponent({
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const myvalue = ref('')
|
||||
const myvalue = ref(<string | number>'')
|
||||
|
||||
function changeval(newval: any) {
|
||||
console.log('changeval', newval)
|
||||
@@ -67,14 +67,17 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
console.log('mounted', mounted)
|
||||
if (props.options) {
|
||||
const rec: any = props.options.find((myrec: any) => myrec[`${props.optval}`] === props.value)
|
||||
// console.log('rec', rec)
|
||||
if (!props.useinput) {
|
||||
if (props.value) {
|
||||
myvalue.value = props.value.toString()
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
console.log('rec', rec, 'props.useinput', props.useinput)
|
||||
console.log('props.value', props.value)
|
||||
console.log('options', props.options)
|
||||
console.log('optval', props.optval)
|
||||
console.log('optlab', props.optlab)
|
||||
*/
|
||||
|
||||
if (rec) {
|
||||
if (props.funcgetvaluebyid)
|
||||
myvalue.value = props.funcgetvaluebyid(rec[`${props.optval}`])
|
||||
@@ -82,6 +85,11 @@ export default defineComponent({
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/components/CSkill/CSkill.scss
Executable file
29
src/components/CSkill/CSkill.scss
Executable 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
56
src/components/CSkill/CSkill.ts
Executable 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,
|
||||
}
|
||||
},
|
||||
})
|
||||
46
src/components/CSkill/CSkill.vue
Executable file
46
src/components/CSkill/CSkill.vue
Executable 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
1
src/components/CSkill/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CSkill } from './CSkill.vue'
|
||||
@@ -9,6 +9,8 @@ const msg_website_it = {
|
||||
quantityAvailable: 'Disponibili',
|
||||
weight: 'Peso',
|
||||
stars: 'Voto',
|
||||
color: 'Colore',
|
||||
theme: 'Tema',
|
||||
},
|
||||
hours: {
|
||||
descr: 'Descrizione',
|
||||
|
||||
@@ -27,24 +27,24 @@ export default function () {
|
||||
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')
|
||||
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) {
|
||||
let ris = toolsext.getValDb(`${keystr}_${toolsext.getLocale()}`, serv, def, table, subkey)
|
||||
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, indrec, subsubkey)
|
||||
if (ris === def) ris = toolsext.getValDb(`${keystr}_it`, serv, def, table, subkey)
|
||||
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 globalStore = useGlobalStore()
|
||||
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
|
||||
|
||||
if (table === 'users') {
|
||||
@@ -53,8 +53,14 @@ export default function () {
|
||||
const myfield: any = {}
|
||||
|
||||
if (key === 'profile') {
|
||||
|
||||
if (subsubkey && indrec) {
|
||||
// @ts-ignore
|
||||
userStore.my.profile[subkey][indrec][subsubkey] = value
|
||||
}else {
|
||||
// @ts-ignore
|
||||
userStore.my.profile[subkey] = value
|
||||
}
|
||||
} else {
|
||||
// @ts-ignore
|
||||
userStore.my[key] = value
|
||||
|
||||
@@ -240,6 +240,7 @@ export interface IGlobalState {
|
||||
URL_RESTORE: string
|
||||
levels: ILevel[],
|
||||
skills: ISkill[],
|
||||
statusSkills: IStatusSkill[],
|
||||
sectors: ISector[],
|
||||
}
|
||||
|
||||
@@ -533,20 +534,45 @@ export interface IPagination {
|
||||
}
|
||||
|
||||
export interface ISkill {
|
||||
_id: number
|
||||
descr: string
|
||||
idSector: string
|
||||
idSector: number[]
|
||||
icon?: string
|
||||
img?: string
|
||||
}
|
||||
|
||||
export interface IStatusSkill {
|
||||
_id: number
|
||||
descr: string
|
||||
color: string
|
||||
theme: string
|
||||
}
|
||||
|
||||
export interface ISector {
|
||||
_id: number
|
||||
descr: string
|
||||
idSector?: number
|
||||
icon?: string
|
||||
img?: string
|
||||
color: string
|
||||
theme: string
|
||||
}
|
||||
|
||||
export interface ILevel {
|
||||
_id: string
|
||||
_id: number
|
||||
descr: string
|
||||
color: string
|
||||
theme: string
|
||||
years_of_exp: number
|
||||
}
|
||||
|
||||
export interface IMySkill {
|
||||
_id: number
|
||||
idSkill: number
|
||||
idStatusSkill: number[]
|
||||
NumLevel: number
|
||||
note: string
|
||||
date_created?: Date,
|
||||
date_updated?: Date,
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import {
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { CSkill } from '@/components/CSkill'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Home',
|
||||
components: { CSkill },
|
||||
setup() {
|
||||
|
||||
return {
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<q-page class="">
|
||||
<h1>Inizio:</h1>
|
||||
|
||||
<CSkill>
|
||||
|
||||
</CSkill>
|
||||
|
||||
</q-page>
|
||||
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
|
||||
// @ts-ignore
|
||||
import { LMap, LIcon, LTileLayer, LMarker, LControlLayers, LTooltip, LPopup, LPolyline, LPolygon, LRectangle, } from '@vue-leaflet/vue-leaflet'
|
||||
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
declare module '@vue-leaflet/vue-leaflet' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
export const LMap: DefineComponent;
|
||||
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 {
|
||||
defineComponent, ref, computed,
|
||||
@@ -10,20 +19,6 @@ import {
|
||||
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({
|
||||
name: 'Home',
|
||||
components: {
|
||||
|
||||
@@ -761,7 +761,16 @@ const msg_it = {
|
||||
telegram_key: 'Chiave Bot Telegram',
|
||||
telegram_bot_name: 'Telegram BotName',
|
||||
pathreg_add: 'Suffisso',
|
||||
}
|
||||
},
|
||||
skill: {
|
||||
name: 'Competenza',
|
||||
},
|
||||
level: {
|
||||
name: 'Livello',
|
||||
},
|
||||
statusSkill: {
|
||||
name: 'Stato',
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@@ -267,31 +267,96 @@ export const colTableStorehouse = [
|
||||
]
|
||||
|
||||
export const colSectors = [
|
||||
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(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({
|
||||
name: 'idSector',
|
||||
label_trans: 'sectors.name',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
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(DuplicateRec),
|
||||
]
|
||||
@@ -1353,6 +1418,13 @@ export const fieldsTable = {
|
||||
colkey: 'key',
|
||||
collabel: 'key',
|
||||
},
|
||||
{
|
||||
value: 'myskills',
|
||||
label: 'Mie Competenze',
|
||||
columns: colmySkills,
|
||||
colkey: '_id',
|
||||
collabel: (rec: any) => `${rec.name} ${rec.surname}`,
|
||||
},
|
||||
{
|
||||
value: 'skills',
|
||||
label: 'Competenze',
|
||||
@@ -1360,6 +1432,13 @@ export const fieldsTable = {
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
},
|
||||
{
|
||||
value: 'statusSkills',
|
||||
label: 'Stato Attuale',
|
||||
columns: colStatusSkills,
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
},
|
||||
{
|
||||
value: 'sectors',
|
||||
label: 'Settori',
|
||||
@@ -1374,6 +1453,13 @@ export const fieldsTable = {
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
},
|
||||
{
|
||||
value: 'citys',
|
||||
label: 'Città',
|
||||
columns: colCitys,
|
||||
colkey: '_id',
|
||||
collabel: 'comune',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ export const toolsext = {
|
||||
// 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 userStore = useUserStore()
|
||||
@@ -143,9 +143,14 @@ export const toolsext = {
|
||||
if (keystr === 'profile') {
|
||||
if (subkey) {
|
||||
// console.log('userStore.my.profile', userStore.my.profile, 'subkey', subkey, )
|
||||
if (subsubkey && indrec) {
|
||||
// @ts-ignore
|
||||
return userStore.my.profile[subkey][indrec][subsubkey]
|
||||
} else {
|
||||
// @ts-ignore
|
||||
return userStore.my.profile[subkey]
|
||||
}
|
||||
}
|
||||
} else if (keystr) { // @ts-ignore
|
||||
// @ts-ignore
|
||||
return userStore.my[keystr]
|
||||
|
||||
@@ -118,6 +118,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
URL_RESTORE: '',
|
||||
levels: [],
|
||||
skills: [],
|
||||
statusSkills: [],
|
||||
sectors: [],
|
||||
}),
|
||||
|
||||
@@ -224,6 +225,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return state.levels
|
||||
else if (table === 'skills')
|
||||
return state.skills
|
||||
else if (table === 'statusSkills')
|
||||
return state.statusSkills
|
||||
else if (table === 'sectors')
|
||||
return state.sectors
|
||||
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) {
|
||||
// const userStore = useUserStore()
|
||||
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.levels = (res.data.levels) ? [...res.data.levels] : []
|
||||
this.skills = (res.data.skills) ? [...res.data.skills] : []
|
||||
this.statusSkills = (res.data.statusSkills) ? [...res.data.statusSkills] : []
|
||||
this.sectors = (res.data.sectors) ? [...res.data.sectors] : []
|
||||
|
||||
// console.log('res.data.cart', res.data.cart)
|
||||
|
||||
Reference in New Issue
Block a user