|
|
@ -1,5 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
|
|
|
|
<div v-show="!showMessage"> |
|
|
|
<v-datetime-picker |
|
|
|
<v-datetime-picker |
|
|
|
ref="picker" |
|
|
|
ref="picker" |
|
|
|
v-model="localState" |
|
|
|
v-model="localState" |
|
|
@ -17,6 +18,11 @@ |
|
|
|
v-on="parentListeners" |
|
|
|
v-on="parentListeners" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-show="showMessage" class="edit-warning" @dblclick="$refs.picker.display = true"> |
|
|
|
|
|
|
|
<!-- TODO: i18n --> |
|
|
|
|
|
|
|
ERR: Couldn't parse {{ this.value }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -31,6 +37,9 @@ export default { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
value: [String, Date, Number], ignoreFocus: Boolean |
|
|
|
value: [String, Date, Number], ignoreFocus: Boolean |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
data: () => ({ |
|
|
|
|
|
|
|
showMessage: false |
|
|
|
|
|
|
|
}), |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
isMysql() { |
|
|
|
isMysql() { |
|
|
|
return ['mysql', 'mysql2'].indexOf(this.$store.getters['project/GtrClientType']) |
|
|
|
return ['mysql', 'mysql2'].indexOf(this.$store.getters['project/GtrClientType']) |
|
|
@ -40,8 +49,13 @@ export default { |
|
|
|
if (!this.value) { |
|
|
|
if (!this.value) { |
|
|
|
return this.value |
|
|
|
return this.value |
|
|
|
} |
|
|
|
} |
|
|
|
return (/^\d+$/.test(this.value) ? dayjs(+this.value) : dayjs(this.value)) |
|
|
|
const d = (/^\d+$/.test(this.value) ? dayjs(+this.value) : dayjs(this.value)) |
|
|
|
.format('YYYY-MM-DD HH:mm') |
|
|
|
if (d.isValid()) { |
|
|
|
|
|
|
|
this.showMessage = false |
|
|
|
|
|
|
|
return d.format('YYYY-MM-DD HH:mm') |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.showMessage = true |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
set(value) { |
|
|
|
set(value) { |
|
|
|
if (this.isMysql) { |
|
|
|
if (this.isMysql) { |
|
|
@ -85,6 +99,12 @@ export default { |
|
|
|
padding-top: 0 !important; |
|
|
|
padding-top: 0 !important; |
|
|
|
font-size: inherit !important; |
|
|
|
font-size: inherit !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.edit-warning { |
|
|
|
|
|
|
|
padding: 10px; |
|
|
|
|
|
|
|
text-align: left; |
|
|
|
|
|
|
|
color: #E65100; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|
<!-- |
|
|
|
<!-- |
|
|
|
/** |
|
|
|
/** |
|
|
|