fix column changed value (fieldtype)
This commit is contained in:
@@ -150,6 +150,8 @@ export default defineComponent({
|
|||||||
// recordCol.value = fieldsTable.getrecTableList(props.table)
|
// recordCol.value = fieldsTable.getrecTableList(props.table)
|
||||||
let columns = fieldsTable.getArrColsByTable(props.table)
|
let columns = fieldsTable.getArrColsByTable(props.table)
|
||||||
|
|
||||||
|
// console.log('table', props.table, 'LAB', optlab.value, 'COL', columns)
|
||||||
|
|
||||||
if (columns) {
|
if (columns) {
|
||||||
col.value = columns.find((col: any) => col.name === props.field)
|
col.value = columns.find((col: any) => col.name === props.field)
|
||||||
} else {
|
} else {
|
||||||
@@ -160,6 +162,7 @@ export default defineComponent({
|
|||||||
jointable.value = col.value.jointable!
|
jointable.value = col.value.jointable!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const arrk = props.field.split('.')
|
const arrk = props.field.split('.')
|
||||||
if (arrk) {
|
if (arrk) {
|
||||||
mykey.value = props.field
|
mykey.value = props.field
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
fieldtype: {{fieldtype}}
|
||||||
<div v-if="visuElem()" :class="mytitle ? `row items-center justify-center q-ma-xs text-center` : ``">
|
<div v-if="visuElem()" :class="mytitle ? `row items-center justify-center q-ma-xs text-center` : ``">
|
||||||
<div v-if="mytitle" class="q-ma-xs">
|
<div v-if="mytitle" class="q-ma-xs">
|
||||||
<q-field rounded outlined :bg-color="($q.dark.isActive ? '' : 'blue-4')" dense style="min-width:110px;">
|
<q-field rounded outlined :bg-color="($q.dark.isActive ? '' : 'blue-4')" dense style="min-width:110px;">
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export default defineComponent({
|
|||||||
// console.log('crea', isFieldDb(), 'props.mycol', props.mycol)
|
// console.log('crea', isFieldDb(), 'props.mycol', props.mycol)
|
||||||
|
|
||||||
if (props.mycol && props.mycol.name && props.mycol.name !== 'test') {
|
if (props.mycol && props.mycol.name && props.mycol.name !== 'test') {
|
||||||
col.value = props.mycol
|
col.value = {...props.mycol}
|
||||||
} else {
|
} else {
|
||||||
if (col.value.name === 'test') {
|
if (col.value.name === 'test') {
|
||||||
col.value.name = props.field
|
col.value.name = props.field
|
||||||
|
|||||||
@@ -119,6 +119,12 @@
|
|||||||
:label="myvalue"
|
:label="myvalue"
|
||||||
>
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
<div v-else>
|
||||||
|
<span
|
||||||
|
:class="{ disabled: disable }"
|
||||||
|
v-html="visuValByType(myvalue, col, row)"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label lines="1">
|
<q-item-label lines="1">
|
||||||
|
|
||||||
<CMyFieldRec
|
<CMyFieldRec
|
||||||
table="users"
|
table="users"
|
||||||
:id="user._id"
|
:id="user._id"
|
||||||
|
|||||||
@@ -2981,7 +2981,7 @@ export const fieldsTable = {
|
|||||||
},
|
},
|
||||||
getArrColsByTable(mytable: string) {
|
getArrColsByTable(mytable: string) {
|
||||||
const tablerec: any = this.tablesList.find((rec) => rec.value === mytable)
|
const tablerec: any = this.tablesList.find((rec) => rec.value === mytable)
|
||||||
if (tablerec) {
|
if (tablerec && tablerec.columns) {
|
||||||
return tablerec.columns
|
return tablerec.columns
|
||||||
} else
|
} else
|
||||||
return null
|
return null
|
||||||
|
|||||||
Reference in New Issue
Block a user