From 1aea88a1fa5b7c8e20959b8c7052f2a5a6563151 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Sat, 19 Feb 2022 22:02:54 +0100 Subject: [PATCH] =?UTF-8?q?Nuova=20Grafica=20,=20Nuovi=20settori=20e=20cat?= =?UTF-8?q?egorie,=20Beni=20e=20Servizi.=20Nella=20Nazionalit=C3=A0=20non?= =?UTF-8?q?=20c'=C3=A8=20Repubblica=20di=20San=20Marino=20Aggiungere=20Bot?= =?UTF-8?q?tone=20di=20"Chiudi"=20nella=20visualizzazione=20della=20Card?= =?UTF-8?q?=20cerca=20persona,=20mettere=20solo=20una=20parte=20della=20pa?= =?UTF-8?q?rola=20da=20cercare...=20Gruppi=20sistemare=20il=20bottone=20di?= =?UTF-8?q?=20Nuovo=20e=20controllare=20altro..=20adTypeBacheca=20per=20la?= =?UTF-8?q?=20tabella=20mybachecas=20(Evento,=20Offro,=20Cerco)=20Semplifi?= =?UTF-8?q?care=20le=20CATEGORIE=20=3F!=20o=20togliere=20la=20Specializzaz?= =?UTF-8?q?ione=3F=20=20(con=20Giovanna)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- _ALL_SITES/freeplanet.app/.env.development | 2 +- _ALL_SITES/freeplanet.app/db/static_data.ts | 19 +- _ALL_SITES/insiemesipuo.app/.env.development | 2 +- _ALL_SITES/insiemesipuo.app/db/static_data.ts | 19 +- .../popolodelnuovomondo.app/.env.development | 2 +- .../popolodelnuovomondo.app/db/static_data.ts | 19 +- src/common/shared_vuejs.ts | 46 +- src/components/CBigBtn/CBigBtn.scss | 38 ++ src/components/CBigBtn/CBigBtn.ts | 10 + src/components/CBigBtn/CBigBtn.vue | 22 +- src/components/CDashboard/CDashboard.ts | 2 +- src/components/CDashboard/CDashboard.vue | 24 +- src/components/CFinder/CFinder.ts | 420 ++++++++++++++---- src/components/CFinder/CFinder.vue | 2 +- .../CFirstPageApp/CFirstPageApp.vue | 4 +- src/components/CGridTableRec/CGridTableRec.ts | 78 ++-- .../CGridTableRec/CGridTableRec.vue | 10 +- src/components/CMainView/CMainView.ts | 15 + src/components/CMainView/CMainView.vue | 52 +-- src/components/CMyCardPopup/CMyCardPopup.vue | 7 + src/components/CMyPopupEdit/CMyPopupEdit.vue | 61 ++- src/components/CSignIn/CSignIn.vue | 4 +- src/components/CSkill/CSkill.ts | 148 +++++- .../CTitlePage/CTitlePage.scss} | 0 src/components/CTitlePage/CTitlePage.ts | 51 +++ src/components/CTitlePage/CTitlePage.vue | 19 + src/components/CTitlePage/index.ts | 1 + src/components/Header/Header.ts | 21 +- src/db/static_data.ts | 22 +- src/model/GlobalStore.ts | 51 ++- src/model/UserStore.ts | 3 +- src/root/bacheca/bacheca.ts | 3 +- src/root/bacheca/bacheca.vue | 1 + src/root/goods/goods.scss | 0 src/root/{work/work.ts => goods/goods.ts} | 10 +- src/root/goods/goods.vue | 29 ++ src/root/services/services.scss | 0 src/root/services/services.ts | 68 +++ .../{work/work.vue => services/services.vue} | 5 +- src/rootgen/admin/groups/groups.ts | 9 +- src/rootgen/admin/groups/groups.vue | 1 + src/rootgen/admin/importdata/importdata.ts | 139 ++++-- src/rootgen/admin/importdata/importdata.vue | 9 +- src/rootgen/admin/usersList/usersList.ts | 15 +- src/rootgen/admin/usersList/usersList.vue | 2 +- src/statics/lang/it.js | 16 +- src/store/Modules/costanti.ts | 78 ++++ src/store/Modules/fieldsTable.ts | 337 ++++++++++++-- src/store/Modules/tools.ts | 39 +- src/store/Modules/toolsext.ts | 1 + src/store/globalStore.ts | 21 +- src/views/admin/dbop/dbop.vue | 10 +- src/views/testServer/testServer.vue | 7 +- src/views/user/editprofile/editprofile.vue | 5 +- src/views/user/myfriends/myfriends.vue | 4 +- src/views/user/mygroup/mygroup.vue | 4 +- src/views/user/mygroups/mygroups.ts | 59 +-- src/views/user/mygroups/mygroups.vue | 3 +- src/views/user/myprofile/myprofile.ts | 2 + src/views/user/myprofile/myprofile.vue | 15 +- 61 files changed, 1669 insertions(+), 399 deletions(-) rename src/{root/work/work.scss => components/CTitlePage/CTitlePage.scss} (100%) create mode 100755 src/components/CTitlePage/CTitlePage.ts create mode 100755 src/components/CTitlePage/CTitlePage.vue create mode 100755 src/components/CTitlePage/index.ts create mode 100755 src/root/goods/goods.scss rename src/root/{work/work.ts => goods/goods.ts} (92%) create mode 100755 src/root/goods/goods.vue create mode 100755 src/root/services/services.scss create mode 100755 src/root/services/services.ts rename src/root/{work/work.vue => services/services.vue} (79%) diff --git a/.env.development b/.env.development index 6c811628..59dd0cba 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.5" +APP_VERSION="0.2.6" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/freeplanet.app/.env.development b/_ALL_SITES/freeplanet.app/.env.development index 4b997013..5dd5a91a 100755 --- a/_ALL_SITES/freeplanet.app/.env.development +++ b/_ALL_SITES/freeplanet.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.5" +APP_VERSION="0.2.6" SERVICE_WORKER_FILE="service-worker.js" APP_ID="1" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/freeplanet.app/db/static_data.ts b/_ALL_SITES/freeplanet.app/db/static_data.ts index ebde12d4..499d123a 100755 --- a/_ALL_SITES/freeplanet.app/db/static_data.ts +++ b/_ALL_SITES/freeplanet.app/db/static_data.ts @@ -392,11 +392,22 @@ const baseroutes: IListRoutes[] = [ }, { active: true, - order: 15, - path: '/work', + order: 12, + path: '/goods', materialIcon: 'fas fa-briefcase', - name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + name: 'mypages.goods', + component: () => import('@/root/goods/goods.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, + { + active: true, + order: 15, + path: '/services', + materialIcon: 'fas fa-briefcase', + name: 'mypages.services', + component: () => import('@/root/services/services.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/_ALL_SITES/insiemesipuo.app/.env.development b/_ALL_SITES/insiemesipuo.app/.env.development index 6c811628..59dd0cba 100755 --- a/_ALL_SITES/insiemesipuo.app/.env.development +++ b/_ALL_SITES/insiemesipuo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.5" +APP_VERSION="0.2.6" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/insiemesipuo.app/db/static_data.ts b/_ALL_SITES/insiemesipuo.app/db/static_data.ts index a4ed2a78..6bc7d572 100755 --- a/_ALL_SITES/insiemesipuo.app/db/static_data.ts +++ b/_ALL_SITES/insiemesipuo.app/db/static_data.ts @@ -392,11 +392,22 @@ const baseroutes: IListRoutes[] = [ }, { active: true, - order: 15, - path: '/work', + order: 12, + path: '/goods', materialIcon: 'fas fa-briefcase', - name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + name: 'mypages.goods', + component: () => import('@/root/goods/goods.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, + { + active: true, + order: 15, + path: '/services', + materialIcon: 'fas fa-briefcase', + name: 'mypages.services', + component: () => import('@/root/services/services.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/_ALL_SITES/popolodelnuovomondo.app/.env.development b/_ALL_SITES/popolodelnuovomondo.app/.env.development index a761a871..191052bc 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/.env.development +++ b/_ALL_SITES/popolodelnuovomondo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.5" +APP_VERSION="0.2.6" SERVICE_WORKER_FILE="service-worker.js" APP_ID="12" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts b/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts index b4d16497..461dd362 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts +++ b/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts @@ -392,11 +392,22 @@ const baseroutes: IListRoutes[] = [ }, { active: true, - order: 15, - path: '/work', + order: 12, + path: '/goods', materialIcon: 'fas fa-briefcase', - name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + name: 'mypages.goods', + component: () => import('@/root/goods/goods.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, + { + active: true, + order: 15, + path: '/services', + materialIcon: 'fas fa-briefcase', + name: 'mypages.services', + component: () => import('@/root/services/services.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index b4c54c85..98e047f5 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -41,10 +41,9 @@ export const shared_consts = { FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288, FILTER_MEMBERSHIP_CARD_OK: 1048576, - FILTER_MYSKILL_SKILL: 1, - OPTIONS_SEARCH_ONLY_FULL_WORDS: 1, OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2, + OPTIONS_SEARCH_USER_ALL_WORDS: 4, FRIENDSCMD: { SETTRUST: 121, @@ -86,21 +85,24 @@ export const shared_consts = { TABLES_MYSKILLS: 'myskills', TABLES_MYBACHECAS: 'mybachecas', + TABLES_MYGOODS: 'mygoods', + + TABLES_ENABLE_GETREC_BYID: ['mybachecas'], TABLES_USER_INCLUDE_MY: ['mygroups'], - TABLES_GETCOMPLETEREC: ['myskills'], - TABLES_PERM_NEWREC: ['skills', 'subskills', 'mygroups'], - TABLES_REC_ID: ['skills', 'subskills'], + TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'mygoods'], + TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups'], + TABLES_REC_ID: ['skills', 'goods', 'subskills'], - TABLES_ID_NUMBER: ['permissions', 'levels', 'adtypes', 'statusSkills', 'sectors', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', 'myskills', 'mybachecas', 'mygroups'], - TABLES_USER_ID: ['myskills', 'mybachecas'], - TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybots'], - TABLES_FINDER: ['myskills', 'mybachecas', 'mygroups'], - TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas'], + TABLES_ID_NUMBER: ['permissions', 'levels', 'adtypes', 'adtypegoods', 'statusSkills', 'sectors', 'sectorgoods', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', + 'myskills', 'mybachecas', 'mygoods', 'mygroups'], + TABLES_USER_ID: ['myskills', 'mybachecas', 'mygoods'], + TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'mygoods', 'mybots'], + TABLES_FINDER: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], + TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'mygoods'], - TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas'], - TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'users'], - TABLES_NOT_SHOW_IF_USERNAME: ['myskills', 'mybachecas'], + TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'mygoods'], + TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'mygoods', 'users'], VISIB_ALL: 0, VISIB_ONLYIF_VERIFIED: 1, @@ -122,8 +124,9 @@ export const shared_consts = { PROVINCE: 1, COMUNI: 2, CITIES_SERVER: 3, - CAT_TXT: 4, + CAT_SKILL_TXT: 4, CAT_NO_SPAZI: 5, + CAT_GOODS_TXT: 10, }, BotType: [ @@ -145,6 +148,21 @@ export const shared_consts = { }, ], + Shippings: [ + { + label: 'Di Persona', + value: 1, + }, + { + label: 'Tramite Corriere', + value: 2, + }, + { + label: 'Tramite Posta', + value: 3, + }, + ], + Provinces: [ { label: 'Agrigento', diff --git a/src/components/CBigBtn/CBigBtn.scss b/src/components/CBigBtn/CBigBtn.scss index e69de29b..bf2fa7f1 100755 --- a/src/components/CBigBtn/CBigBtn.scss +++ b/src/components/CBigBtn/CBigBtn.scss @@ -0,0 +1,38 @@ +.my-text { + font-size: 1rem; + font-weight: bold; + line-height: 1.5rem; + letter-spacing: 0.0125em; +} + +.my-text_3 { + font-size: 1rem; + font-weight: bold; + line-height: 1.5rem; + letter-spacing: 0.0125em; +} + +.my-text-small { + font-size: 1rem; + line-height: 1rem; + letter-spacing: 0.0125em; +} + +.mybox_3 { + min-width: 100px; + min-height: 100px; + + width: 100%; +} + +.mybox { + min-width: 125px; + min-height: 137px; + + width: 100%; +} + +.mybox_small { + min-width: 110px; + width: 100%; +} diff --git a/src/components/CBigBtn/CBigBtn.ts b/src/components/CBigBtn/CBigBtn.ts index ab83c103..1572522d 100755 --- a/src/components/CBigBtn/CBigBtn.ts +++ b/src/components/CBigBtn/CBigBtn.ts @@ -29,6 +29,16 @@ export default defineComponent({ required: false, default: 'grey' }, + small: { + type: Boolean, + required: false, + default: false + }, + numcol: { + type: Number, + required: false, + default: 3 + }, }, setup(props, { emit }) { diff --git a/src/components/CBigBtn/CBigBtn.vue b/src/components/CBigBtn/CBigBtn.vue index 8c8ff7d3..3813f11b 100755 --- a/src/components/CBigBtn/CBigBtn.vue +++ b/src/components/CBigBtn/CBigBtn.vue @@ -1,10 +1,26 @@ diff --git a/src/components/CDashboard/CDashboard.ts b/src/components/CDashboard/CDashboard.ts index fe2445f9..ec00b568 100755 --- a/src/components/CDashboard/CDashboard.ts +++ b/src/components/CDashboard/CDashboard.ts @@ -19,7 +19,7 @@ export default defineComponent({ const globalStore = useGlobalStore() const { t } = useI18n(); - const calcstat = computed(() => userStore.my.calcstat ? userStore.my.calcstat : {numUsersReg: 0, numMySkills: 0, numMyBachecas: 0} ) + const calcstat = computed(() => userStore.my.calcstat ? userStore.my.calcstat : {numUsersReg: 0, numMySkills: 0, numMyGoods: 0, numMyBachecas: 0} ) return { userStore, diff --git a/src/components/CDashboard/CDashboard.vue b/src/components/CDashboard/CDashboard.vue index 33242eb6..376c4f58 100755 --- a/src/components/CDashboard/CDashboard.vue +++ b/src/components/CDashboard/CDashboard.vue @@ -51,7 +51,29 @@ {{ calcstat.numMyBachecas }} - Annunci + Dacci un Occhio + + + + + + + + +
+
+
+
+
+ + +
+ + + + {{ calcstat.numMyGoods }} + Beni diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 4502ea49..34e625bf 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -28,14 +28,14 @@ export default defineComponent({ CMyFieldDb, CGridTableRec, }, setup(props, { attrs, slots, emit }) { - const mytable = 'users' const { t } = useI18n() const globalStore = useGlobalStore() const userStore = useUserStore() const arrfilterand: any = ref([]) const filtercustom: any = ref([]) - const searchList = ref([]) + const searchList_Servizi = ref([]) + const searchList_Beni = ref([]) const search = ref('') const myrecfiltertoggle = ref(tools.FILTER_ALL) @@ -45,22 +45,25 @@ export default defineComponent({ const col_footer = ref('idCity') const col_tabfooter = ref('mycities') - const mypagination = ref({ sortBy: 'date_created', descending: true, page: 1, rowsNumber: 10, rowsPerPage: 10 }) + const mypagination = ref({ sortBy: 'date_created', descending: true, page: 1, rowsNumber: 20, rowsPerPage: 20 }) const col = ref({}) - const idSector = computed(() => { + /* + const idSectorServizi = computed(() => { let myval: any = null - myval = searchList.value.find((rec) => (rec.table === 'sectors')) + myval = searchList_Servizi.value.find((rec) => (rec.table === 'sectors')) if (myval) { const ris = myval.value || 0 - // console.log('idSector=', ris) + // console.log('idSectorServizi=', ris) return ris } else { return 0 } }) + */ + watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => { if (value === tools.FILTER_MYREC) { filtercustom.value = [{ userId: userStore.my._id }] @@ -70,6 +73,15 @@ export default defineComponent({ }, ) + const searchList = computed(() => { + if (props.table === 'mygoods') + return searchList_Beni.value + else if (props.table === 'myskills') + return searchList_Servizi.value + + return searchList_Servizi.value + }) + function mounted() { @@ -93,6 +105,16 @@ export default defineComponent({ } } + function getFilterGoods(recGood: any, index: number, arr: any) { + const recsectorGoods: any = searchList.value.find((rec) => rec.table === 'sectorgoods') + // console.log('getFilterSkills', recSkill.idSector, recsectors.value) + if (recsectorGoods) { + return recGood.idSectorGood.includes(recsectorGoods.value) + } else { + return true + } + } + function getFilterSubSkills(recSubSkill: any, index: number, arr: any) { const recskills: any = searchList.value.find((rec) => rec.table === 'skills') // console.log('recSubSkill', recSubSkill, 'recskills', recskills) @@ -114,9 +136,30 @@ export default defineComponent({ } - - - searchList.value = [ + searchList_Servizi.value = [ + { + label: 'Stato', + table: 'statusSkills', + key: 'idStatusSkill', + value: 0, + // arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []), + arrvalue: [], + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'mood', + filteradv: true, + }, + /*{ + label: 'Regione', + table: 'regions', + key: 'idReg', + value: 0, + type: costanti.FieldType.select, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'regions', [costanti.FILTER_TUTTI]), + filter: null, + useinput: true, + },*/ { label: 'Provincia', table: 'provinces', @@ -130,7 +173,7 @@ export default defineComponent({ icon: 'flag', }, { - label: 'Città', + label: 'Comune', table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, @@ -167,7 +210,7 @@ export default defineComponent({ useinput: false, }, { - label: 'Competenza', + label: 'Categoria', table: 'skills', key: 'idSkill', value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'sectors', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), @@ -178,7 +221,7 @@ export default defineComponent({ showcount: true, useinput: false, }, - { + /*{ label: 'Specializzazione', table: 'subskills', key: 'idSubSkill', @@ -191,16 +234,11 @@ export default defineComponent({ useinput: false, icon: 'far fa-id-card', }, - /*{ - label: 'Regione', - table: 'regions', - key: 'idReg', - value: 0, - type: costanti.FieldType.select, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'regions', [costanti.FILTER_TUTTI]), - filter: null, - useinput: true, - },*/ + */ + + + + /* { label: 'Livello', table: 'levels', @@ -213,20 +251,160 @@ export default defineComponent({ useinput: false, filteradv: true, }, + + + */ { - label: 'Stato', - table: 'statusSkills', - key: 'idStatusSkill', + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', value: 0, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []), + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), type: costanti.FieldType.multiselect, filter: null, useinput: false, - icon: 'mood', + icon: 'fas fa-hand-holding', filteradv: true, + //icon: 'swap_horizontal_circle', + }, + /* + { + label: '', + table: '', + key: '', + value: 0, + type: costanti.FieldType.separator, + arrvalue: [], + addall: true, + filter: null, + showcount: true, + useinput: false, + notinsearch: true, + icon: '', + }, + + */ + + ] + + searchList_Beni.value = [ + /*{ + label: 'Regione', + table: 'regions', + key: 'idReg', + value: 0, + type: costanti.FieldType.select, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'regions', [costanti.FILTER_TUTTI]), + filter: null, + useinput: true, + },*/ + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: true, + icon: 'flag', }, { - label: 'Contributo', + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + { + label: 'Offro/Cerco', + table: 'adtypegoods', + key: 'adType', + value: tools.getCookie(tools.COOK_SEARCH + 'adtypegoods', costanti.FILTER_TUTTI), + arrvalue: [], + addall: true, + type: costanti.FieldType.select, + filter: null, + useinput: false, + }, + { + label: 'Settore', + table: 'sectorgoods', + key: 'idSectorGood', + value: tools.getCookie(tools.COOK_SEARCH + 'sectorgoods', 0), + arrvalue: [], + type: costanti.FieldType.select, + filter: null, + addall: true, + notinsearch: true, + useinput: false, + }, + { + label: 'Categoria', + table: 'goods', + key: 'idGood', + value: tools.getCookie(tools.COOK_SEARCH + 'goods' + '_' + tools.getCookie(tools.COOK_SEARCH + 'sectorgoods', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: getFilterGoods, + showcount: true, + useinput: false, + }, + { + label: 'Spedizione', + table: 'shippings', + key: 'idShipping', + value: tools.getCookie(tools.COOK_SEARCH + 'shippings', costanti.FILTER_TUTTI), + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: null, + useinput: false, + }, + /*{ + label: 'Specializzazione', + table: 'subskills', + key: 'idSubSkill', + value: tools.getCookie(tools.COOK_SEARCH + 'subskills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'skills', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), + type: costanti.FieldType.select, + arrvalue: [], + addall: true, + filter: getFilterSubSkills, + showcount: true, + useinput: false, + icon: 'far fa-id-card', + }, + */ + + + + /* + { + label: 'Livello', + table: 'levels', + key: 'numLevel', + value: tools.getCookie(tools.COOK_SEARCH + 'levels', costanti.FILTER_TUTTI), + arrvalue: [], + addall: true, + type: costanti.FieldType.select, + filter: null, + useinput: false, + filteradv: true, + }, + + + */ + { + label: 'In cambio di', table: 'contribtypes', key: 'idContribType', value: 0, @@ -259,73 +437,124 @@ export default defineComponent({ } - - function extraparams() { - return { - lookup1: { - lk_tab: 'users', - lk_LF: 'userId', - lk_FF: '_id', - lk_as: 'user', - af_objId_tab: 'myId', - }, - lookup2: { - lk_tab: 'skills', - lk_LF: 'idSkill', - lk_FF: '_id', - lk_as: 'recSkill', - af_objId_tab: '', - lk_proj: { - recSkill: 1, - sector: 1, - idSector: 1, - idSkill: 1, - idSubSkill: 1, - myskill: 1, - idStatusSkill: 1, - idContribType: 1, - idCity: 1, - numLevel: 1, - adType: 1, - photos: 1, - note: 1, - website: 1, - //**ADDFIELD_MYSKILL - descr: 1, - date_created: 1, - date_updated: 1, - userId: 1, - username: 1, - name: 1, - surname: 1, - comune: 1, - mycities: 1, - 'profile.img': 1, - 'profile.qualifica': 1, - } - }, - lookup3: { - lk_tab: 'sectors', - lk_LF: 'recSkill.idSector', - lk_FF: '_id', - lk_as: 'sector', - af_objId_tab: '', - }, - lookup4: { - lk_tab: 'subskills', - lk_LF: 'idSubSkill', - lk_FF: '_id', - lk_as: 'myrec', - af_objId_tab: '', - }, - lookup5: { - lk_tab: 'cities', - lk_LF: 'idCity', - lk_FF: '_id', - lk_as: 'mycities', - af_objId_tab: '', - }, + if (props.table === 'myskills') { + return { + lookup1: { + lk_tab: 'users', + lk_LF: 'userId', + lk_FF: '_id', + lk_as: 'user', + af_objId_tab: 'myId', + }, + lookup2: { + lk_tab: 'skills', + lk_LF: 'idSkill', + lk_FF: '_id', + lk_as: 'recSkill', + af_objId_tab: '', + lk_proj: { + recSkill: 1, + sector: 1, + idSector: 1, + idSkill: 1, + // idSubSkill: 1, + myskill: 1, + idStatusSkill: 1, + idContribType: 1, + idCity: 1, + numLevel: 1, + adType: 1, + photos: 1, + note: 1, + website: 1, + //**ADDFIELD_MYSKILL + descr: 1, + date_created: 1, + date_updated: 1, + userId: 1, + username: 1, + name: 1, + surname: 1, + comune: 1, + mycities: 1, + 'profile.img': 1, + 'profile.qualifica': 1, + } + }, + lookup3: { + lk_tab: 'sectors', + lk_LF: 'recSkill.idSector', + lk_FF: '_id', + lk_as: 'sector', + af_objId_tab: '', + }, + lookup5: { + lk_tab: 'cities', + lk_LF: 'idCity', + lk_FF: '_id', + lk_as: 'mycities', + af_objId_tab: '', + }, + } + } else if (props.table === 'myskills') { + return { + lookup1: { + lk_tab: 'users', + lk_LF: 'userId', + lk_FF: '_id', + lk_as: 'user', + af_objId_tab: 'myId', + }, + lookup2: { + lk_tab: 'goods', + lk_LF: 'idGood', + lk_FF: '_id', + lk_as: 'recGood', + af_objId_tab: '', + lk_proj: { + recGood: 1, + sectorGood: 1, + idSectorGood: 1, + idGood: 1, + mygood: 1, + idStatusSkill: 1, + idContribType: 1, + idCity: 1, + numLevel: 1, + adType: 1, + photos: 1, + note: 1, + website: 1, + //**ADDFIELD_MYSKILL + descr: 1, + date_created: 1, + date_updated: 1, + userId: 1, + username: 1, + name: 1, + surname: 1, + comune: 1, + mycities: 1, + 'profile.img': 1, + 'profile.qualifica': 1, + } + }, + lookup3: { + lk_tab: 'sectorgoods', + lk_LF: 'recGood.idSectorGood', + lk_FF: '_id', + lk_as: 'sectorgood', + af_objId_tab: '', + }, + lookup5: { + lk_tab: 'cities', + lk_LF: 'idCity', + lk_FF: '_id', + lk_as: 'mycities', + af_objId_tab: '', + }, + } } } @@ -334,6 +563,8 @@ export default defineComponent({ return tools.getdefaultnewrec_MySkill() } else if (props.table === toolsext.TABMYBACHECAS) { return tools.getdefaultnewrec_MyBacheca() + } else if (props.table === toolsext.TABMYGOODS) { + return tools.getdefaultnewrec_MyGoods() } return null } @@ -353,7 +584,6 @@ export default defineComponent({ arrfilterand, filtercustom, searchList, - idSector, search, doSearch, myrecfiltertoggle, diff --git a/src/components/CFinder/CFinder.vue b/src/components/CFinder/CFinder.vue index f3db5674..7babc6aa 100755 --- a/src/components/CFinder/CFinder.vue +++ b/src/components/CFinder/CFinder.vue @@ -37,7 +37,7 @@ :vertical="costanti.VISUTABLE_LISTA" :prop_pagination="mypagination" :showType="costanti.SHOW_MYCARD" - :nodataLabel="'Nessuna Competenza trovata'" + :nodataLabel="'Nessun annuncio trovato con i filtri selezionati'" :prop_search="true" :finder="true" :choose_visutype="$q.screen.gt.xs" diff --git a/src/components/CFirstPageApp/CFirstPageApp.vue b/src/components/CFirstPageApp/CFirstPageApp.vue index 2e240c47..ab5056cc 100755 --- a/src/components/CFirstPageApp/CFirstPageApp.vue +++ b/src/components/CFirstPageApp/CFirstPageApp.vue @@ -1,6 +1,6 @@ Ambiente di Test - + -->
diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index c7b8806f..2e18ae4f 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -299,50 +299,40 @@ export default defineComponent({ refresh() }) + function setCategBySector(tablecat: string, tabsector: string, newval: any) { + const recSector = searchList.value.find((rec) => rec.table === tabsector) + if (recSector) + tools.setCookie(tools.COOK_SEARCH + tablecat + '_' + recSector.value, newval) + + for (const item of searchList.value) { + if (item.table === tablecat) { + const valsaved = tools.getCookie(tools.COOK_SEARCH + tablecat + '_' + newval, costanti.FILTER_TUTTI) + const rec = searchList.value.find((rec) => rec.table === tablecat) // check if exist + let trovato = false + if (rec) { + const arrvalues = valoriopt.value(rec.value, false) + if (arrvalues) + trovato = arrvalues.find((rec: any) => rec[rec.key] === valsaved) + } + if (valsaved && trovato) + item.value = valsaved + else + item.value = costanti.FILTER_TUTTI + } + } + + } + function searchval(newval: any, table: any) { // console.log('searchval', newval, table) tools.setCookie(tools.COOK_SEARCH + table, newval) if (table === 'skills') { - const recSector = searchList.value.find((rec) => rec.table === 'sectors') - if (recSector) - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + setCategBySector(table, 'sectors', newval) + }else if (table === 'goods') { + setCategBySector(table, 'sectorgoods', newval) } - if (table === 'sectors') { - for (const item of searchList.value) { - if ((item.table === 'subskills')) { - // item.arrvalue = [costanti.FILTER_TUTTI] - } - if (item.table === 'skills') { - // console.log('---PRIMA ', item.value) - const valsaved = tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + newval, costanti.FILTER_TUTTI) - // check if exist - const recSkill = searchList.value.find((rec) => rec.table === 'skills') - let trovato = false - if (recSkill) { - // console.log('recSkill.value', recSkill) - const arrvalues = valoriopt.value(recSkill.value, false) - // console.log('arrvalues', arrvalues) - if (arrvalues) - trovato = arrvalues.find((rec: any) => rec[recSkill.key] === valsaved) - } - if (valsaved && trovato) - item.value = valsaved - else - item.value = costanti.FILTER_TUTTI - // console.log('---DOPO ', item.value) - } - } - } - /*if (table === 'skills') { - for (const item of searchList.value) { - if (item.table === 'subskills') { - item.arrvalue = [costanti.FILTER_TUTTI] - } - } - } */ - refresh() } @@ -412,15 +402,21 @@ export default defineComponent({ let filtersearch3or: any[] = [] let recSector = null + let recSectorGood = null let recProvince = null let recSkill = null let idSector = 0 + let idSectorGood = 0 let idProvince = 0 let idSkill = 0 if (searchList.value) { recSector = searchList.value.find((item: ISearchList) => item.table === 'sectors') idSector = recSector ? recSector.value : 0 } + if (searchList.value) { + recSectorGood = searchList.value.find((item: ISearchList) => item.table === 'sectorgoods') + idSectorGood = recSectorGood ? recSectorGood.value : 0 + } if (searchList.value) { recProvince = searchList.value.find((item: ISearchList) => item.table === 'provinces') idProvince = recProvince ? recProvince.value : 0 @@ -494,6 +490,14 @@ export default defineComponent({ filtersearch2.push(obj2) } } + if ((item.table === 'goods') && item.value === costanti.FILTER_TUTTI) { + let obj2: any = {} + if (idSectorGood > 0) { + // idSectorGood + obj2['sectorgood._id'] = idSectorGood + filtersearch2.push(obj2) + } + } if ((item.table === 'subskills') && item.value === costanti.FILTER_TUTTI) { let obj2: any = {} // idSector diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index a9e65d42..94d13b45 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -106,9 +106,10 @@
-
+ + @@ -497,7 +499,7 @@ v-for="col in mycolumns" :key="col.name" class="newrec_fields">
- +
@@ -542,7 +544,7 @@
- +
diff --git a/src/components/CMainView/CMainView.ts b/src/components/CMainView/CMainView.ts index 02dc0ff6..82269114 100755 --- a/src/components/CMainView/CMainView.ts +++ b/src/components/CMainView/CMainView.ts @@ -4,6 +4,7 @@ import { useRouter } from 'vue-router' import { useGlobalStore } from '@store/globalStore' import { useI18n } from '@/boot/i18n' import { tools } from '@store/Modules/tools' +import { costanti } from '@store/Modules/costanti' import { CBigBtn } from '@/components/CBigBtn' @@ -18,9 +19,23 @@ export default defineComponent({ const globalStore = useGlobalStore() const { t } = useI18n() + const showInfo = ref(false) + + const cardsbig = computed(() => { + return costanti.MAINCARDS.filter((rec: any) => !rec.small) + }) + + const cardssmall = computed(() => { + return costanti.MAINCARDS.filter((rec: any) => rec.small) + }) + return { userStore, tools, + costanti, + cardsbig, + cardssmall, + showInfo, } } }) diff --git a/src/components/CMainView/CMainView.vue b/src/components/CMainView/CMainView.vue index a175f1e1..1f4bd8ef 100755 --- a/src/components/CMainView/CMainView.vue +++ b/src/components/CMainView/CMainView.vue @@ -1,32 +1,34 @@ + + diff --git a/src/components/CTitlePage/index.ts b/src/components/CTitlePage/index.ts new file mode 100755 index 00000000..e780ca15 --- /dev/null +++ b/src/components/CTitlePage/index.ts @@ -0,0 +1 @@ +export {default as CTitlePage} from './CTitlePage.vue' diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 7652b717..fa1096cc 100755 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -345,13 +345,18 @@ export default defineComponent({ } function getappname() { - let mystr = tools.getsuffisso() + tools.getappname(tools.isMobile()) - if (!tools.isMobile()) { - //if (!tools.isMobile()) { - mystr += ' ' + getAppVersion() - //} + let mystr = '' + if (tools.isTest()){ + mystr = 'Ambiente di TEST' } else { - mystr = '' + let mystr = tools.getsuffisso() + tools.getappname(tools.isMobile()) + if (!tools.isMobile()) { + //if (!tools.isMobile()) { + mystr += ' ' + getAppVersion() + //} + } else { + mystr = '' + } } return mystr @@ -420,9 +425,9 @@ export default defineComponent({ } function getClassColorHeader() { - if (tools.isTest()) return 'bg-warning' + if (tools.isTest()) return 'bg-light-blue' if (tools.isDebug()) return 'bg-info' - return 'bg-primary' + return 'bg-light-blue' } function changecmd(value: any) { diff --git a/src/db/static_data.ts b/src/db/static_data.ts index a4ed2a78..570283b4 100755 --- a/src/db/static_data.ts +++ b/src/db/static_data.ts @@ -380,23 +380,34 @@ const baseroutes: IListRoutes[] = [ infooter: true, }, { - active: true, + active: false, order: 100, path: '/bacheca', materialIcon: 'fas fa-bullhorn', name: 'mypages.bacheca', component: () => import('@/root/bacheca/bacheca.vue'), meta: { requiresAuth: true }, + inmenu: false, + infooter: false, + }, + { + active: true, + order: 12, + path: '/goods', + materialIcon: 'fas fa-briefcase', + name: 'mypages.goods', + component: () => import('@/root/goods/goods.vue'), + meta: { requiresAuth: true }, inmenu: true, infooter: true, }, { active: true, order: 15, - path: '/work', + path: '/services', materialIcon: 'fas fa-briefcase', - name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + name: 'mypages.services', + component: () => import('@/root/services/services.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, @@ -507,8 +518,7 @@ const baseroutes: IListRoutes[] = [ materialIcon: 'fas fa-test', name: 'mypages.test', component: () => import('@/views/testServer/testServer.vue'), - meta: { requiresAuth: true }, - inmenu: false, + inmenu: true, infooter: false, }, { diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 0ee9d243..1dfffd8f 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -258,10 +258,13 @@ export interface IGlobalState { URL_RESTORE: string levels: ILevel[], adtypes: IAdType[], + adtypegoods: IAdType[], skills: ISkill[], - subSkills: ISubSkill[], + goods: IGood[], + // subSkills: ISubSkill[], statusSkills: IStatusSkill[], sectors: ISector[], + sectorgoods: ISectorGood[], catgrps: ICatGrp[], cities: ICity[], } @@ -619,7 +622,15 @@ export interface ISkill { icon?: string img?: string } +export interface IGood { + _id: number + descr: string + idSectorGood: number[] + icon?: string + img?: string +} +/* export interface ISubSkill { _id: number descr: string @@ -628,13 +639,18 @@ export interface ISubSkill { img?: string } + */ + + export interface IStatusSkill { _id: number descr: string color: string + icon: string theme: string } + export interface ISector { _id: number descr: string @@ -645,6 +661,16 @@ export interface ISector { theme: string } +export interface ISectorGood { + _id: number + descr: string + idSectorGood?: number + icon?: string + img?: string + color: string + theme: string +} + export interface ICatGrp { _id: number descr: string @@ -679,7 +705,26 @@ export interface IMySkill { _id: number idSector: number idSkill: number - idSubSkill: number[] + // idSubSkill: number[] + idStatusSkill: number[] + idContribType: string[] + idCity: number[] + photos: IGallery[] + NumLevel: number + adType: number + note: string + //**ADDFIELD_MYSKILL + website: string + descr: string + date_created?: Date, + date_updated?: Date, +} + +export interface IMyGoods { + _id: number + idSector: number + idSkill: number + idShipping: number[] idStatusSkill: number[] idContribType: string[] idCity: number[] @@ -698,7 +743,7 @@ export interface IMyBacheca { _id: number idSector: number idSkill: number - idSubSkill: number[] + // idSubSkill: number[] idStatusSkill: number[] idContribType: string[] idCity: number[] diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts index cc3b289d..8ecf0377 100755 --- a/src/model/UserStore.ts +++ b/src/model/UserStore.ts @@ -59,7 +59,8 @@ export interface IUserProfile { resplist?: any workerslist?: any dateofbirth?: Date|null - born_city?: string + born_city_id?: number + born_city_str?: string born_province?: string born_country?: string my_dream?: string diff --git a/src/root/bacheca/bacheca.ts b/src/root/bacheca/bacheca.ts index ed41ef99..8fa8408e 100755 --- a/src/root/bacheca/bacheca.ts +++ b/src/root/bacheca/bacheca.ts @@ -9,6 +9,7 @@ import { CFinder } from '@/components/CFinder' import { CDashboard } from '@/components/CDashboard' import { CChartMap } from '@src/components/CChartMap' import { CUserNonVerif } from '@/components/CUserNonVerif' +import { CTitlePage } from '@/components/CTitlePage' import { CMapsEsempio } from '@src/components/CMapsEsempio' import { CVerifyEmail } from '@src/components/CVerifyEmail' import { CVerifyTelegram } from '@src/components/CVerifyTelegram' @@ -22,7 +23,7 @@ import { colmyBachecas } from '@store/Modules/fieldsTable' export default defineComponent({ name: 'bacheca', - components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif }, + components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage }, setup() { const globalStore = useGlobalStore() const userStore = useUserStore() diff --git a/src/root/bacheca/bacheca.vue b/src/root/bacheca/bacheca.vue index c3137ed4..94117504 100755 --- a/src/root/bacheca/bacheca.vue +++ b/src/root/bacheca/bacheca.vue @@ -4,6 +4,7 @@
+ diff --git a/src/root/goods/goods.scss b/src/root/goods/goods.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/root/work/work.ts b/src/root/goods/goods.ts similarity index 92% rename from src/root/work/work.ts rename to src/root/goods/goods.ts index 14c325b9..f5630f9d 100755 --- a/src/root/work/work.ts +++ b/src/root/goods/goods.ts @@ -9,6 +9,7 @@ import { CFinder } from '@/components/CFinder' import { CDashboard } from '@/components/CDashboard' import { CChartMap } from '@src/components/CChartMap' import { CUserNonVerif } from '@/components/CUserNonVerif' +import { CTitlePage } from '@/components/CTitlePage' import { CMapsEsempio } from '@src/components/CMapsEsempio' import { CVerifyEmail } from '@src/components/CVerifyEmail' import { CVerifyTelegram } from '@src/components/CVerifyTelegram' @@ -18,19 +19,15 @@ import { static_data } from '@/db/static_data' import MixinBase from '@/mixins/mixin-base' import MixinUsers from '@/mixins/mixin-users' -import { colmySkills } from '@store/Modules/fieldsTable' - export default defineComponent({ - name: 'bacheca', - components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif }, + name: 'Goods', + components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage }, setup() { const globalStore = useGlobalStore() const userStore = useUserStore() const { getValDb } = MixinBase() const { isEmailVerified, TelegVerificato } = MixinUsers() - - function TelegCode() { return userStore.my.profile.teleg_checkcode } @@ -65,7 +62,6 @@ export default defineComponent({ openrighttoolbar, isUserOk, getLinkBotTelegram, - colmySkills, } }, }) diff --git a/src/root/goods/goods.vue b/src/root/goods/goods.vue new file mode 100755 index 00000000..85b89284 --- /dev/null +++ b/src/root/goods/goods.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/root/services/services.scss b/src/root/services/services.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/root/services/services.ts b/src/root/services/services.ts new file mode 100755 index 00000000..bbf2552a --- /dev/null +++ b/src/root/services/services.ts @@ -0,0 +1,68 @@ +import { + defineComponent, ref, computed, +} from 'vue' + +import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' +import { CSkill } from '@/components/CSkill' +import { CFinder } from '@/components/CFinder' +import { CDashboard } from '@/components/CDashboard' +import { CTitlePage } from '@/components/CTitlePage' +import { CChartMap } from '@src/components/CChartMap' +import { CUserNonVerif } from '@/components/CUserNonVerif' +import { CMapsEsempio } from '@src/components/CMapsEsempio' +import { CVerifyEmail } from '@src/components/CVerifyEmail' +import { CVerifyTelegram } from '@src/components/CVerifyTelegram' +import { useGlobalStore } from '@store/globalStore' +import { useUserStore } from '@store/UserStore' +import { static_data } from '@/db/static_data' +import MixinBase from '@/mixins/mixin-base' +import MixinUsers from '@/mixins/mixin-users' +import { costanti } from '@costanti' + +export default defineComponent({ + name: 'Services', + components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage }, + setup() { + const globalStore = useGlobalStore() + const userStore = useUserStore() + const { getValDb } = MixinBase() + const { isEmailVerified, TelegVerificato } = MixinUsers() + + function TelegCode() { + return userStore.my.profile.teleg_checkcode + } + + function openrighttoolbar() { + globalStore.rightDrawerOpen = true + } + + function isLogged() { + return userStore.isLogged + } + function isUserOk() { + return userStore.isUserOk() + } + + function getLinkBotTelegram(): string { + if ( tools.isTest() && !process.env.DEV) { + return getValDb('TELEG_BOT_LINK_TEST', false) + } else{ + return getValDb('TELEG_BOT_LINK', false) + } + } + + return { + tools, + toolsext, + static_data, + isEmailVerified, + TelegCode, + TelegVerificato, + isLogged, + openrighttoolbar, + isUserOk, + getLinkBotTelegram, + } + }, +}) diff --git a/src/root/work/work.vue b/src/root/services/services.vue similarity index 79% rename from src/root/work/work.vue rename to src/root/services/services.vue index e0e85551..4c7e6119 100755 --- a/src/root/work/work.vue +++ b/src/root/services/services.vue @@ -1,5 +1,6 @@ - diff --git a/src/rootgen/admin/groups/groups.ts b/src/rootgen/admin/groups/groups.ts index 454ec72d..ed8bcdc3 100755 --- a/src/rootgen/admin/groups/groups.ts +++ b/src/rootgen/admin/groups/groups.ts @@ -7,13 +7,20 @@ import { CTitleBanner } from '@/components/CTitleBanner' import { CGridTableRec } from '@/components/CGridTableRec' import { colTablegroups } from '@src/store/Modules/fieldsTable' +import { tools } from '@store/Modules/tools' export default defineComponent({ name: 'GroupPage', components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec }, setup() { + + function getdefaultnewrec(): any { + return tools.getdefaultnewrec_MyGroup() + } + return { - colTablegroups + colTablegroups, + getdefaultnewrec } } }) diff --git a/src/rootgen/admin/groups/groups.vue b/src/rootgen/admin/groups/groups.vue index 6e6e071e..b7d14850 100755 --- a/src/rootgen/admin/groups/groups.vue +++ b/src/rootgen/admin/groups/groups.vue @@ -15,6 +15,7 @@ prop_mytable="groups" prop_mytitle="Gruppi" :prop_mycolumns="colTablegroups" + :defaultnewrec="getdefaultnewrec" prop_colkey="descr" nodataLabel="Nessun Gruppo" noresultLabel="Il filtro selezionato non ha trovato nessun risultato"> diff --git a/src/rootgen/admin/importdata/importdata.ts b/src/rootgen/admin/importdata/importdata.ts index 9a547f28..85e2c78d 100755 --- a/src/rootgen/admin/importdata/importdata.ts +++ b/src/rootgen/admin/importdata/importdata.ts @@ -20,7 +20,9 @@ export default defineComponent({ const globalStore = useGlobalStore() const arrSector = ref([]) + const arrSectorGood = ref([]) const arrSkill = ref([]) + const arrGood = ref([]) const incaricamento = ref(false) @@ -30,6 +32,8 @@ export default defineComponent({ const inputfile = ref('') const risultato = ref('') + const caricaDatiToggle = ref(false) + const ListaCmd = ref( [ { @@ -45,8 +49,12 @@ export default defineComponent({ value: shared_consts.Cmd.CITIES_SERVER }, { - label: 'Importa Categorie da TXT', - value: shared_consts.Cmd.CAT_TXT + label: 'Importa Categorie Servizi da TXT', + value: shared_consts.Cmd.CAT_SKILL_TXT + }, + { + label: 'Importa Categorie Beni (Goods) da TXT', + value: shared_consts.Cmd.CAT_GOODS_TXT }, { label: 'converti da TXT seperato senza spazi', @@ -55,8 +63,16 @@ export default defineComponent({ ] ) - function created() { - inputfile.value = '' + function caricadati() { + + if (!caricaDatiToggle.value) { + arrSector.value = [] + arrSectorGood.value = [] + arrSkill.value = [] + arrGood.value = [] + + return + } const sortBy = 'descr' const descending = 1 @@ -67,7 +83,7 @@ export default defineComponent({ myobj[sortBy] = 1 const params: IParamsQuery = { - table: 'sectors', + table: '', startRow: 0, endRow: 10000, filter: '', @@ -80,42 +96,89 @@ export default defineComponent({ userId: '' } - globalStore.loadTable(params).then((data) => { - arrSector.value = data.rows - }) + if (true) { + params.table = 'sectors' + globalStore.loadTable(params).then((data) => { + arrSector.value = data.rows + }) + params.table = 'sectorgoods' + globalStore.loadTable(params).then((data) => { + arrSectorGood.value = data.rows + }) - params.table = 'skills' - globalStore.loadTable(params).then((data) => { - arrSkill.value = data.rows - }) + params.table = 'skills' + globalStore.loadTable(params).then((data) => { + arrSkill.value = data.rows + }) + + params.table = 'goods' + globalStore.loadTable(params).then((data) => { + arrGood.value = data.rows + }) + } } - function createSector(cat: string) { - const myid = arrSector.value.length + 1 - arrSector.value.push({_id: myid, descr: cat}) + function created() { + inputfile.value = '' + + if (caricaDatiToggle.value) { + caricadati() + } + } + + function createSector(cat: string, cmd: number) { + let arr = [] + if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { + arr = arrSectorGood.value + } else { + arr = arrSector.value + } + + const myid = arr.length + 1 + arr.push({_id: myid, descr: cat}) return myid } - function findidSector(cat: string) { - const rec = arrSector.value.find((rec) => rec.descr === cat) + function findidSector(cat: string, cmd: number) { + let arr = [] + if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { + arr = arrSectorGood.value + } else { + arr = arrSector.value + } + + const rec = arr.find((rec) => rec.descr === cat) if (rec) { return rec._id } return 0; } - function findidSkill(cat: string) { - const rec = arrSkill.value.find((rec) => rec.descr === cat) + function findidSkill(cat: string, cmd: number) { + let arr = [] + if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { + arr = arrGood.value + } else { + arr = arrSkill.value + } + + const rec = arr.find((rec) => rec.descr === cat) if (rec) { return rec._id } return 0; } - function createSkill(cat: string) { - const myid = arrSkill.value.length + 1 - arrSkill.value.push({_id: myid, descr: cat}) + function createSkill(cat: string, cmd: number) { + let arr = [] + if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { + arr = arrGood.value + } else { + arr = arrSkill.value + } + const myid = arr.length + 1 + arr.push({_id: myid, descr: cat}) return myid } @@ -147,7 +210,7 @@ export default defineComponent({ arrstr = myarr[i].split(',') sector = arrstr[0] skill = arrstr[1] - sotto_cat = arrstr[2] + // sotto_cat = arrstr[2] // sotto_cat = myarr[i].replace('\'', '\\\'') // sector = myarr[i+2] if (skill) @@ -156,9 +219,9 @@ export default defineComponent({ sector = sector.replace('\'', '\\\'') if (sector) { - idSector = findidSector(sector) + idSector = findidSector(sector, cmd) if (!idSector) { - idSector = createSector(sector) + idSector = createSector(sector, cmd) // sectors strsectors += '{ \n' @@ -168,19 +231,25 @@ export default defineComponent({ } if (skill !== '') { - idSkill = findidSkill(skill) + idSkill = findidSkill(skill, cmd) if (!idSkill) { - idSkill = createSkill(skill) + idSkill = createSkill(skill, cmd) // skills strskills += '{ \n' - strsectors += ' _id:' + idSkill + ',' - strskills += ' idSector: [' + idSector + '],' + strskills += ' _id:' + idSkill + ',' + if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { + strskills += ' idSectorGood: [' + idSector + '],' + }else if (cmd === shared_consts.Cmd.CAT_SKILL_TXT) { + strskills += ' idSector: [' + idSector + '],' + } + strskills += ' descr:\'' + skill + '\',' strskills += '}, \n' } } + /* if (sotto_cat !== '') { // subskills strsubskills += '{ \n' @@ -188,6 +257,8 @@ export default defineComponent({ strsubskills += ' descr:\'' + sotto_cat + '\',' strsubskills += '}, \n' } + + */ } indrecsub++ @@ -199,9 +270,11 @@ export default defineComponent({ ris += 'module.exports = {\n' + ' list: [' + strskills + ']' ris += '



' - ris += 'module.exports = {\n' + + /*ris += 'module.exports = {\n' + ' list: [' + strsubskills + ']' + */ + return ris } @@ -241,7 +314,9 @@ export default defineComponent({ delim = ',' } else if ((cmd === shared_consts.Cmd.COMUNI) || (cmd === shared_consts.Cmd.CITIES_SERVER)) { delim = ';' - } else if (cmd === shared_consts.Cmd.CAT_TXT) { + } else if (cmd === shared_consts.Cmd.CAT_SKILL_TXT) { + return importCmdTxt(cmd, testo); + } else if (cmd === shared_consts.Cmd.CAT_GOODS_TXT) { return importCmdTxt(cmd, testo); } else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) { return importNoSpazi(cmd, testo); @@ -326,6 +401,8 @@ export default defineComponent({ cosafare, ListaCmd, eseguiCmd, + caricaDatiToggle, + caricadati, } } }) diff --git a/src/rootgen/admin/importdata/importdata.vue b/src/rootgen/admin/importdata/importdata.vue index 299ac083..c11ba74a 100755 --- a/src/rootgen/admin/importdata/importdata.vue +++ b/src/rootgen/admin/importdata/importdata.vue @@ -1,6 +1,9 @@