- Gallery
- Popupedit semplificato
This commit is contained in:
@@ -25,7 +25,7 @@ export default defineComponent({
|
||||
required: true,
|
||||
},
|
||||
imgGall: {
|
||||
type: Object as PropType<IImgGallery | string | undefined | null>,
|
||||
type: Object as PropType<IImgGallery[] | string | undefined | null>,
|
||||
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
|
||||
|
||||
@@ -27,3 +27,11 @@
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
|
||||
.newrec_fields{
|
||||
display: flex;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -175,13 +175,29 @@
|
||||
:style="props.selected ? 'transform: scale(0.95);' : ''"
|
||||
>
|
||||
<q-card :class="props.selected ? 'bg-grey-2' : ''">
|
||||
<q-list dense>
|
||||
<div v-for="col in mycolumns" :key="col.name">
|
||||
<q-item v-if="colVisib.includes(col.field + col.subfield)" :class="clByCol(col)">
|
||||
<q-item-section avatar v-if="visuIntestazCol(col)">
|
||||
<q-item-label class="q-table__col">{{ col.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-bar dense class="bg-primary text-white">
|
||||
<span class="ellipsis"> {{ props.row[col_title] }} </span>
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat round color="white" icon="fas fa-pencil-alt" size="sm"
|
||||
@click="clickFunz(props.row, prop_mycolumns.find((rec) => rec.action === lists.MenuAction.CAN_EDIT_TABLE))"></q-btn>
|
||||
<q-btn
|
||||
flat round color="white" icon="fas fa-trash-alt" size="sm"
|
||||
@click="clickFunz(props.row, prop_mycolumns.find((rec) => rec.action === lists.MenuAction.DELETE_RECTABLE))"></q-btn>
|
||||
</q-bar>
|
||||
<!--<q-toolbar dense v-if="col_title" class="bg-primary text-white centeritems">
|
||||
<q-toolbar-title>
|
||||
{{ props.row[col_title] }}
|
||||
</q-toolbar-title>
|
||||
</q-toolbar>-->
|
||||
<q-card-section class="inset-shadow">
|
||||
<q-list dense>
|
||||
<div v-for="col in mycolumns" :key="col.name">
|
||||
<q-item v-if="colVisib.includes(col.field + col.subfield)" :class="clByCol(col)">
|
||||
<q-item-section avatar v-if="visuIntestazCol(col)">
|
||||
<q-item-label class="q-table__col">{{ col.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<div class="tdclass">
|
||||
<div :class="getclrow(props.row)">
|
||||
|
||||
@@ -201,30 +217,11 @@
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
<div>
|
||||
<q-item-section>
|
||||
<q-item-label class="q-table__col"></q-item-label>
|
||||
</q-item-section>
|
||||
<q-item class="row justify-center">
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
<q-item>
|
||||
<div v-for="col in mycolumns" :key="col.name">
|
||||
<div v-if="colExtra.includes(col.name) && col.action" class="tdclass">
|
||||
<q-btn
|
||||
flat round color="red" :icon="col.icon" size="sm"
|
||||
@click="clickFunz(props.row, col)"></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</q-list>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</q-list>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -283,18 +280,17 @@
|
||||
</div>
|
||||
<q-dialog v-model="newRecordBool" @hide="hidewindow">
|
||||
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;`">
|
||||
<q-toolbar class="bg-primary text-white centeritems">
|
||||
<q-toolbar-title>
|
||||
{{ mytitle }}
|
||||
</q-toolbar-title>
|
||||
<q-bar dense class="bg-primary text-white">
|
||||
Nuovo:
|
||||
<q-space />
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
</q-bar>
|
||||
<q-card-section class="inset-shadow">
|
||||
<div
|
||||
v-for="col in mycolumns" :key="col.name">
|
||||
v-for="col in mycolumns" :key="col.name" class="newrec_fields">
|
||||
<div
|
||||
v-if="colVisib.includes(col.field + col.subfield)">
|
||||
<div>
|
||||
<div class="">
|
||||
|
||||
<CMyPopupEdit
|
||||
:table="prop_mytable"
|
||||
@@ -303,8 +299,9 @@
|
||||
v-model:row="newRecord"
|
||||
:field="col.field"
|
||||
:subfield="col.subfield"
|
||||
:isInModif="true"
|
||||
minuteinterval="1"
|
||||
:visulabel="true"
|
||||
:visulabel="false"
|
||||
@save="SaveValue"
|
||||
@show="selItem(newRecord, col)"
|
||||
@showandsave="showandsel">
|
||||
@@ -322,12 +319,12 @@
|
||||
</q-dialog>
|
||||
<q-dialog v-model="editRecordBool">
|
||||
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;`">
|
||||
<q-toolbar class="bg-primary text-white centeritems">
|
||||
<q-toolbar-title>
|
||||
{{ mytitle }}
|
||||
</q-toolbar-title>
|
||||
<q-bar dense class="bg-primary text-white">
|
||||
<span v-if="mytitle">{{ mytitle }}</span>
|
||||
<span v-else>{{ recModif[col_title] }}</span>
|
||||
<q-space />
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
</q-bar>
|
||||
<q-card-section class="inset-shadow">
|
||||
<div
|
||||
v-for="col in mycolumns" :key="col.name">
|
||||
|
||||
@@ -53,7 +53,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function refreshval() {
|
||||
console.log('refreshval')
|
||||
// console.log('refreshval')
|
||||
myarrvalues.value = []
|
||||
|
||||
// console.log('options', props.options)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-card :style="`min-width: `+ tools.myheight_dialog() + `px;` ">
|
||||
<q-toolbar class="bg-primary text-white" style="min-height: 30px;">
|
||||
<q-toolbar v-if="showButtons" class="bg-primary text-white" style="min-height: 30px;">
|
||||
<q-toolbar-title>
|
||||
Editor
|
||||
</q-toolbar-title>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.editor{
|
||||
border: solid 2px #1c64aa;
|
||||
border: solid 1px #257ed5;
|
||||
border-radius: 5px;
|
||||
padding: 2px;
|
||||
height: 60px;
|
||||
|
||||
@@ -14,6 +14,11 @@ import { CGallery } from '../CGallery'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
// import VueTelInput from 'vue3-tel-input'
|
||||
// import 'vue3-tel-input/dist/vue3-tel-input.css'
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
import MixinUsers from '@/mixins/mixin-users'
|
||||
@@ -219,6 +224,9 @@ export default defineComponent({
|
||||
console.log('popypedit: changevalRec', newval)
|
||||
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
|
||||
// console.log('row[col.value.name]', props.row[col.value.name])
|
||||
if (props.type === costanti.FieldType.image) {
|
||||
console.log('image', newval)
|
||||
}
|
||||
myrow.value[col.value.name] = newval
|
||||
// console.log('changevalRec update:row', newval)
|
||||
emit('update:row', props.row)
|
||||
@@ -527,6 +535,14 @@ export default defineComponent({
|
||||
SaveValueInt(myvalue.value, '')
|
||||
}
|
||||
|
||||
function noPopupeditByCol(mycol: IColGridTable) {
|
||||
return (mycol.fieldtype !== costanti.FieldType.html
|
||||
&& mycol.fieldtype !== costanti.FieldType.image
|
||||
&& mycol.fieldtype !== costanti.FieldType.listimages
|
||||
&& mycol.fieldtype !== costanti.FieldType.number
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
onBeforeMount(mounted)
|
||||
|
||||
@@ -562,6 +578,7 @@ export default defineComponent({
|
||||
isFieldDb,
|
||||
col,
|
||||
myImgGall,
|
||||
noPopupeditByCol,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmySkills"
|
||||
prop_colkey="idSkill"
|
||||
col_title="subTitle"
|
||||
:vertical="true"
|
||||
nodataLabel="Nessuna Competenza inserita"
|
||||
:prop_search="false"
|
||||
|
||||
Reference in New Issue
Block a user