Fixed CDateTime component and CMyChipList
This commit is contained in:
@@ -4,17 +4,20 @@ export const shared_consts = {
|
|||||||
Admin: {
|
Admin: {
|
||||||
value: 1,
|
value: 1,
|
||||||
label: 'pages.Admin',
|
label: 'pages.Admin',
|
||||||
icon: 'fas fa-user-shield'
|
icon: 'fas fa-user-shield',
|
||||||
|
color: 'red'
|
||||||
},
|
},
|
||||||
Manager: {
|
Manager: {
|
||||||
value: 2,
|
value: 2,
|
||||||
label: 'otherpages.manage.manager',
|
label: 'otherpages.manage.manager',
|
||||||
icon: 'fas fa-tools'
|
icon: 'fas fa-tools',
|
||||||
|
color: 'green'
|
||||||
},
|
},
|
||||||
Teacher: {
|
Teacher: {
|
||||||
value: 4,
|
value: 4,
|
||||||
label: 'event.teacher',
|
label: 'event.teacher',
|
||||||
icon: 'fas fa-user-tie'
|
icon: 'fas fa-user-tie',
|
||||||
|
color: 'blue'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,7 @@
|
|||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar_comp {
|
||||||
|
vertical-align: center;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ import { toolsext } from '@src/store/Modules/toolsext'
|
|||||||
|
|
||||||
import { date } from 'quasar'
|
import { date } from 'quasar'
|
||||||
import { CalendarStore } from '../../store/Modules'
|
import { CalendarStore } from '../../store/Modules'
|
||||||
|
import MixinBase from '../../mixins/mixin-base'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'CDateTime'
|
name: 'CDateTime',
|
||||||
|
mixins: [MixinBase]
|
||||||
})
|
})
|
||||||
|
|
||||||
export default class CDateTime extends Vue {
|
export default class CDateTime extends Vue {
|
||||||
public $q
|
public $q
|
||||||
public $t
|
public $t
|
||||||
@Prop() public value!: Date
|
@Prop() public value!: Date
|
||||||
@Prop({ required: false, default: '' }) public label: string
|
@Prop({ required: true, default: 'Val:' }) public label: string
|
||||||
@Prop({ required: false, default: '' }) public data_class!: string
|
@Prop({ required: false, default: '' }) public data_class!: string
|
||||||
@Prop({ required: false, default: false }) public readonly!: boolean
|
@Prop({ required: false, default: true }) public canEdit!: boolean
|
||||||
@Prop({ required: false, default: false }) public disable!: boolean
|
@Prop({ required: false, default: false }) public disable!: boolean
|
||||||
@Prop({ required: false, default: '' }) public bgcolor!: string
|
@Prop({ required: false, default: '' }) public bgcolor!: string
|
||||||
@Prop({ required: false, default: false }) public dense: boolean
|
@Prop({ required: false, default: false }) public dense: boolean
|
||||||
@@ -74,10 +76,18 @@ export default class CDateTime extends Vue {
|
|||||||
|
|
||||||
public mounted() {
|
public mounted() {
|
||||||
this.myvalue = this.value
|
this.myvalue = this.value
|
||||||
|
console.log('myvalue', this.myvalue)
|
||||||
}
|
}
|
||||||
|
|
||||||
public changeval(newval) {
|
public changeval(newval) {
|
||||||
// console.log('changeval', newval)
|
// console.log('changeval', newval)
|
||||||
this.$emit('update:value', newval)
|
this.$emit('update:value', newval)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public mystyle() {
|
||||||
|
if (this.label !== '')
|
||||||
|
return ''
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="" :style="mystyle">
|
||||||
<q-input v-model="myvalue"
|
<q-input v-model="myvalue"
|
||||||
|
v-show="false"
|
||||||
color="blue-6"
|
color="blue-6"
|
||||||
|
hide-bottom-space
|
||||||
outlined
|
outlined
|
||||||
|
borderless
|
||||||
:label="label"
|
:label="label"
|
||||||
:bg-color="bgcolor"
|
:bg-color="bgcolor"
|
||||||
:readonly="readonly"
|
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
:dense="dense"
|
:dense="dense"
|
||||||
mask="####-##-## ##:##"
|
mask="####-##-## ##:##"
|
||||||
debounce="500"
|
debounce="500"
|
||||||
@input="changeval"
|
@input="changeval"
|
||||||
:class="getclass">
|
:input-class="getclass"
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
|
|
||||||
<template #append>
|
<q-field
|
||||||
<q-icon name="event" class="cursor-pointer">
|
:label="label"
|
||||||
|
stack-label
|
||||||
|
:value="myvalue"
|
||||||
|
outlined
|
||||||
|
:dense="dense"
|
||||||
|
color="blue-6"
|
||||||
|
:bg-color="bgcolor"
|
||||||
|
debounce="500"
|
||||||
|
:input-class="getclass">
|
||||||
|
|
||||||
|
<template v-slot:control>
|
||||||
|
<div style="">
|
||||||
|
<div class="self-center full-width no-outline" :style="mystyle" tabindex="0">
|
||||||
|
{{ tools.getstrDateTime(myvalue) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon v-if="canEdit" name="event" class="cursor-pointer">
|
||||||
<q-popup-proxy v-model="showDateTimeScroller">
|
<q-popup-proxy v-model="showDateTimeScroller">
|
||||||
|
|
||||||
<q-date-time-scroller
|
<q-date-time-scroller
|
||||||
@@ -35,7 +58,8 @@
|
|||||||
</q-popup-proxy>
|
</q-popup-proxy>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-field>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" src="./CDateTime.ts">
|
<script lang="ts" src="./CDateTime.ts">
|
||||||
|
|||||||
@@ -92,11 +92,11 @@
|
|||||||
<div v-if="col.fieldtype === tools.FieldType.date">
|
<div v-if="col.fieldtype === tools.FieldType.date">
|
||||||
<div :class="getclassCol(col)">
|
<div :class="getclassCol(col)">
|
||||||
<CDateTime
|
<CDateTime
|
||||||
|
:label="col.label"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
:value.sync="props.row[col.name]"
|
:value.sync="props.row[col.name]"
|
||||||
:label="col.title"
|
|
||||||
:dense="true"
|
:dense="true"
|
||||||
:readonly="true"
|
:canEdit="canEdit"
|
||||||
@savetoclose="SaveValue"
|
@savetoclose="SaveValue"
|
||||||
@show="selItem(props.row, col)"
|
@show="selItem(props.row, col)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -25,10 +25,15 @@ export default class CMyChipList extends Vue {
|
|||||||
return tools
|
return tools
|
||||||
}
|
}
|
||||||
|
|
||||||
public mounted() {
|
@Watch('value', { immediate: true, deep: true })
|
||||||
|
public valchange() {
|
||||||
|
this.refreshval()
|
||||||
|
}
|
||||||
|
|
||||||
|
public refreshval() {
|
||||||
this.myarrvalues = []
|
this.myarrvalues = []
|
||||||
|
|
||||||
console.table(this.options)
|
// console.table(this.options)
|
||||||
this.options.forEach((rec, index) => {
|
this.options.forEach((rec, index) => {
|
||||||
if (tools.isBitActive(this.value, rec[this.optval])) {
|
if (tools.isBitActive(this.value, rec[this.optval])) {
|
||||||
const mydata = {
|
const mydata = {
|
||||||
@@ -51,7 +56,10 @@ export default class CMyChipList extends Vue {
|
|||||||
if (this.myarrvalues.length === 0)
|
if (this.myarrvalues.length === 0)
|
||||||
this.myarrvalues.push({ label: this.$t('otherpages.manage.nessuno'), color: 'gray' })
|
this.myarrvalues.push({ label: this.$t('otherpages.manage.nessuno'), color: 'gray' })
|
||||||
|
|
||||||
console.log('arrvalues=', this.myarrvalues)
|
// console.log('arrvalues=', this.myarrvalues)
|
||||||
|
}
|
||||||
|
|
||||||
|
public mounted() {
|
||||||
|
this.refreshval()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default class CMyToggleList extends Vue {
|
|||||||
public mounted() {
|
public mounted() {
|
||||||
this.myarrvalues = []
|
this.myarrvalues = []
|
||||||
|
|
||||||
console.table(this.options)
|
// console.table(this.options)
|
||||||
this.options.forEach((rec) => {
|
this.options.forEach((rec) => {
|
||||||
const mydata = {
|
const mydata = {
|
||||||
label: this.$t(rec[this.optlab]),
|
label: this.$t(rec[this.optlab]),
|
||||||
|
|||||||
Reference in New Issue
Block a user