From c517dedd471cd827081518a4b26823d380ce9772 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Fri, 3 Dec 2021 22:47:53 +0100 Subject: [PATCH] - Gallery - Popupedit semplificato --- package.json | 9 +- src/components/CGallery/CGallery.ts | 4 +- .../CGridTableRec/CGridTableRec.scss | 8 + src/components/CGridTableRec/CGridTableRec.ts | 31 +- .../CGridTableRec/CGridTableRec.vue | 85 +- src/components/CMyChipList/CMyChipList.ts | 2 +- src/components/CMyEditor/CMyEditor.vue | 2 +- src/components/CMyPopupEdit/CMyPopupEdit.scss | 2 +- src/components/CMyPopupEdit/CMyPopupEdit.ts | 17 + src/components/CMyPopupEdit/CMyPopupEdit.vue | 1097 ++++++++--------- src/components/CSkill/CSkill.vue | 1 + src/statics/lang/de.js | 2 +- src/statics/lang/enUs.js | 2 +- src/statics/lang/es.js | 2 +- src/statics/lang/fr.js | 2 +- src/statics/lang/it.js | 12 +- src/statics/lang/pt.js | 2 +- src/statics/lang/si.js | 2 +- src/store/Modules/fieldsTable.ts | 6 +- yarn.lock | 16 +- 20 files changed, 625 insertions(+), 679 deletions(-) diff --git a/package.json b/package.json index a3767c45..6e22fb8a 100755 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "dotenv": "^10.0.0", "echarts": "^5.2.2", "eslint-plugin-quasar": "^1.0.0", + "eslint-plugin-standard": "^5.0.0", "graphql": "^16.0.1", "graphql-tag": "^2.12.6", "gsap": "^3.8.0", @@ -70,10 +71,10 @@ "vue2-dragula": "^2.5.5", "vue3-tel-input": "^1.0.4", "vuex": "^4.0.1", - "vuex-router-sync": "^6.0.0-rc.1", - "vuex-typex": "^3.1.9" + "vuex-router-sync": "^6.0.0-rc.1" }, "devDependencies": { + "@babel/core": "^7.16.0", "@babel/eslint-parser": "^7.16.3", "@quasar/app": "^3.2.3", "@quasar/quasar-app-extension-qcalendar": "^4.0.0-beta.6", @@ -114,6 +115,7 @@ "typescript": "^4.5.2", "vue-cli-plugin-element-ui": "^1.1.4", "vueify": "^9.4.1", + "webpack": "^5.0.0", "workbox-webpack-plugin": "^6.4.1" }, "browser": { @@ -134,6 +136,5 @@ "node": ">= 14.17.0", "npm": ">= 6.14.8", "yarn": ">= 1.21.1" - }, - + } } diff --git a/src/components/CGallery/CGallery.ts b/src/components/CGallery/CGallery.ts index a61ef224..01ab056b 100755 --- a/src/components/CGallery/CGallery.ts +++ b/src/components/CGallery/CGallery.ts @@ -25,7 +25,7 @@ export default defineComponent({ required: true, }, imgGall: { - type: Object as PropType, + type: Object as PropType, required: true, }, }, @@ -55,7 +55,7 @@ export default defineComponent({ }) function created() { - console.log('created cgallery') + // console.log('created cgallery') if (isValid(props.imgGall)) { // @ts-ignore let myarr: any = props.imgGall diff --git a/src/components/CGridTableRec/CGridTableRec.scss b/src/components/CGridTableRec/CGridTableRec.scss index 5e843b59..98063c1d 100755 --- a/src/components/CGridTableRec/CGridTableRec.scss +++ b/src/components/CGridTableRec/CGridTableRec.scss @@ -27,3 +27,11 @@ color: gray; } } + +.newrec_fields{ + display: flex; + padding: 2px; + margin: 2px; + align-items: center; + justify-content: center; +} diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 958ee073..1b3b8e30 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -110,6 +110,11 @@ export default defineComponent({ type: Function, required: false, }, + col_title: { + type: String, + required: false, + default: '', + }, }, components: { CMyPopupEdit, CTitleBanner }, setup(props, { emit }) { @@ -605,7 +610,6 @@ export default defineComponent({ editRecordBool.value = true } else { - return $q.dialog({ message: translate(col.askaction) + '?', html: true, @@ -613,7 +617,7 @@ export default defineComponent({ label: ok, push: true, }, - title: 'Action', + title: translate(col.label_trans), cancel: true, persistent: false, }).onOk(() => { @@ -804,7 +808,30 @@ export default defineComponent({ } } + function enableSaveNewRec() { + + let ok = true + + mycolumns.value.forEach((col: IColGridTable) => { + if (col.required) { + console.log('newRecord.value', newRecord.value, newRecord.value[col.name]) + if (!newRecord.value[col.name]) { + + ok = false + } + } + }) + + return ok + } + async function saveNewRecord() { + // check if the field are setted + + if (!enableSaveNewRec()){ + return false + } + console.log('saveNewRecord') const mydata = { table: mytable.value, diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 36b5bc16..2463a9df 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -175,13 +175,29 @@ :style="props.selected ? 'transform: scale(0.95);' : ''" > - -
- - - {{ col.label }} - - + + {{ props.row[col_title] }} + + + + + + + +
+ + + {{ col.label }} + +
@@ -201,30 +217,11 @@
-
-
-
-
- - - - - - - -
-
- -
-
-
-
-
-
-
-
+
+
+
+
+
@@ -283,18 +280,17 @@ - - - {{ mytitle }} - + + Nuovo: + - +
+ v-for="col in mycolumns" :key="col.name" class="newrec_fields">
-
+
@@ -322,12 +319,12 @@ - - - {{ mytitle }} - + + {{ mytitle }} + {{ recModif[col_title] }} + - +
diff --git a/src/components/CMyChipList/CMyChipList.ts b/src/components/CMyChipList/CMyChipList.ts index 999cbf8a..2181c5c4 100755 --- a/src/components/CMyChipList/CMyChipList.ts +++ b/src/components/CMyChipList/CMyChipList.ts @@ -53,7 +53,7 @@ export default defineComponent({ }) function refreshval() { - console.log('refreshval') + // console.log('refreshval') myarrvalues.value = [] // console.log('options', props.options) diff --git a/src/components/CMyEditor/CMyEditor.vue b/src/components/CMyEditor/CMyEditor.vue index 84c8c148..dd861a30 100755 --- a/src/components/CMyEditor/CMyEditor.vue +++ b/src/components/CMyEditor/CMyEditor.vue @@ -1,7 +1,7 @@