CheckBox, Pages, Editor
This commit is contained in:
@@ -69,7 +69,7 @@ export default defineComponent({
|
||||
const saveit = ref(false)
|
||||
const myvalue = ref(new Date())
|
||||
const valueprec = ref(new Date())
|
||||
const valueDate = toRef(props, 'valueDate')
|
||||
const myvalueDate = toRef(props, 'valueDate')
|
||||
|
||||
function getclass() {
|
||||
return 'calendar_comp ' + props.data_class
|
||||
@@ -80,10 +80,10 @@ export default defineComponent({
|
||||
saveit.value = false
|
||||
valueprec.value = myvalue.value
|
||||
if (myvalue.value === undefined) {
|
||||
valueDate.value = new Date()
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(valueDate.value)
|
||||
myvalueDate.value = new Date()
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
}
|
||||
// console.log('Opening', valueDate, myvalue)
|
||||
// console.log('Opening', myvalueDate, myvalue)
|
||||
emit('show')
|
||||
}
|
||||
|
||||
@@ -97,9 +97,11 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => props.valueDate, (value, oldval) => {
|
||||
if (props.valueDate)
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(props.valueDate)
|
||||
watch(() => myvalueDate.value, (value, oldval) => {
|
||||
if (myvalueDate.value) {
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
console.log('myvalue Date = ', myvalue.value)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@@ -129,7 +131,7 @@ export default defineComponent({
|
||||
if (props.value !== null)
|
||||
myvalue.value = props.value
|
||||
else
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(valueDate.value)
|
||||
myvalue.value = tools.getstrYYMMDDDateTime(myvalueDate.value)
|
||||
|
||||
// console.log('created myvalue', myvalue)
|
||||
}
|
||||
@@ -166,6 +168,8 @@ export default defineComponent({
|
||||
Closing,
|
||||
Opening,
|
||||
getclass,
|
||||
myvalue,
|
||||
showDateTimeScroller,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,72 +1,82 @@
|
||||
<template>
|
||||
<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"
|
||||
:readonly="true"
|
||||
:dense="dense"
|
||||
mask="####-##-## ##:##"
|
||||
debounce="500"
|
||||
@input="changeval"
|
||||
:input-class="getclass"
|
||||
>
|
||||
</q-input>
|
||||
<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"
|
||||
:readonly="true"
|
||||
:dense="dense"
|
||||
mask="####-##-## ##:##"
|
||||
debounce="500"
|
||||
@input="changeval"
|
||||
:input-class="getclass"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
<q-field
|
||||
:label="label"
|
||||
stack-label
|
||||
:value="myvalue"
|
||||
outlined
|
||||
:dense="dense"
|
||||
color="blue-6"
|
||||
:bg-color="bgcolor"
|
||||
debounce="500"
|
||||
:input-class="getclass">
|
||||
<q-field
|
||||
: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">
|
||||
{{ getstrDate(myvalue) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="canEdit" name="event" class="cursor-pointer">
|
||||
<q-popup-proxy v-model="showDateTimeScroller" @before-show="Opening" @before-hide="Closing">
|
||||
<template v-slot:control>
|
||||
<div style="">
|
||||
<div class="self-center full-width no-outline" :style="mystyle" tabindex="0">
|
||||
{{ getstrDate(myvalue) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="canEdit" name="event" class="cursor-pointer">
|
||||
<q-popup-proxy v-model="showDateTimeScroller" @before-show="Opening" @before-hide="Closing">
|
||||
<!--
|
||||
<q-input
|
||||
v-model="myvalue"
|
||||
type="datetime"
|
||||
@input="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
>
|
||||
</q-input>
|
||||
-->
|
||||
<!--
|
||||
<q-scroller
|
||||
v-model="myvalue"
|
||||
:view="view"
|
||||
:locale="toolsext.getLocale()"
|
||||
:rounded-borders="true"
|
||||
border-color="#2196f3"
|
||||
bar-color="#2196f3"
|
||||
text-color="white"
|
||||
color="primary"
|
||||
:minute-interval="minuteinterval"
|
||||
inner-text-color="primary"
|
||||
inner-color="white"
|
||||
:style="scrollerPopupStyle280"
|
||||
@input="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
></q-scroller>
|
||||
-->
|
||||
|
||||
<q-scroller
|
||||
v-model="myvalue"
|
||||
:view="view"
|
||||
:locale="toolsext.getLocale()"
|
||||
:rounded-borders="true"
|
||||
border-color="#2196f3"
|
||||
bar-color="#2196f3"
|
||||
text-color="white"
|
||||
color="primary"
|
||||
:minute-interval="minuteinterval"
|
||||
inner-text-color="primary"
|
||||
inner-color="white"
|
||||
:style="scrollerPopupStyle280"
|
||||
@input="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
></q-scroller>
|
||||
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-field>
|
||||
</div>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-field>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CDateTime.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CDateTime.scss';
|
||||
@import './CDateTime.scss';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user