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