行编辑列表JVxeTable时间控件问题修复

pull/170/head^2
zhangdaiscott 2022-09-25 09:54:42 +08:00
parent 6c2dfc29f2
commit a250827b37
4 changed files with 8 additions and 27 deletions

View File

@ -6,6 +6,7 @@
:showTime="isDatetime"
dropdownClassName="j-vxe-date-picker"
style="min-width: 0"
v-model:open="openPicker"
v-bind="cellProps"
@change="handleChange"
/>
@ -14,7 +15,6 @@
<script lang="ts">
import { ref, computed, watch, defineComponent } from 'vue';
import dayjs from 'dayjs';
import { dispatchEvent } from '/@/components/jeecg/JVxeTable/utils';
import { JVxeComponent, JVxeTypes } from '/@/components/jeecg/JVxeTable/types';
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
import { isEmpty } from '/@/utils/is';
@ -30,6 +30,7 @@
let format = originColumn.value.format;
return format ? format : isDatetime.value ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
});
const openPicker = ref(true);
watch(
innerValue,
(val) => {
@ -51,24 +52,13 @@
isDatetime,
dateFormat,
innerDateValue,
openPicker,
handleChange,
};
},
// JVxeComponent.Enhanced
enhanced: {
aopEvents: {
editActived({ $event, row, column }) {
dispatchEvent({
$event,
row,
column,
props: this.props,
instance: this,
className: '.ant-calendar-picker',
isClick: false,
handler: (el) => el.children[0].click(),
});
},
},
} as JVxeComponent.EnhancedPartial,
});

View File

@ -5,6 +5,7 @@
:format="format"
dropdownClassName="j-vxe-time-picker"
style="min-width: 0"
v-model:open="openPicker"
v-bind="cellProps"
@change="handleChange"
:getPopupContainer="(node) => node.parentNode"
@ -15,7 +16,6 @@
import { ref, computed, watch, defineComponent } from 'vue';
import dayjs from 'dayjs';
import { TimePicker } from 'ant-design-vue';
import { dispatchEvent } from '/@/components/jeecg/JVxeTable/utils';
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
import { isEmpty } from '/@/utils/is';
@ -31,6 +31,7 @@
let format = originColumn.value.format;
return format ? format : 'HH:mm:ss';
});
const openPicker = ref(true);
watch(
innerValue,
(val) => {
@ -51,23 +52,13 @@
cellProps,
format,
innerTimeValue,
openPicker,
handleChange,
};
},
// JVxeComponent.Enhanced
enhanced: {
aopEvents: {
editActived({ $event, row, column }) {
dispatchEvent({
$event,
row,
column,
props: this.props,
instance: this,
className: '.ant-time-picker-input',
isClick: true,
});
},
},
} as JVxeComponent.EnhancedPartial,
});

View File

@ -190,7 +190,7 @@
key: 'datetime',
type: JVxeTypes.datetime,
width: 200,
defaultValue: '2019-4-30 14:52:22',
defaultValue: '2019-04-30 14:52:22',
placeholder: '请选择',
},
{

View File

@ -56,7 +56,7 @@
key: 'datetime',
type: JVxeTypes.datetime,
width: 240,
defaultValue: '2019-4-30 14:52:22',
defaultValue: '2019-04-30 14:51:22',
placeholder: '请选择',
},
{