hookehuyr

fix 日期相关组件调整默认值获取方式

<!--
* @Date: 2022-08-31 11:45:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-06 16:12:36
* @LastEditTime: 2024-06-13 14:30:42
* @FilePath: /data-table/src/components/DatePickerField/index.vue
* @Description: 日期选择组件
-->
......@@ -75,6 +75,7 @@ const maxDate = ref()
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
currentDate.value = props.item.component_props.default ? props.item.component_props.default.split("-") : props.item.value.split("-");
let Year = '';
let Month = '';
......
<!--
* @Date: 2022-09-08 15:02:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-07 16:46:30
* @LastEditTime: 2024-06-13 14:32:20
* @FilePath: /data-table/src/components/DateTimePickerField/index.vue
* @Description: 日期时间选择器
-->
......@@ -81,6 +81,7 @@ const maxDate = ref()
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value.split(" ");
currentDate.value = datetime[0]?.split("-");
currentTime.value = datetime[1]?.split(":");
......
<!--
* @Date: 2022-08-31 11:45:30
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-06 16:12:16
* @LastEditTime: 2024-06-13 14:33:24
* @FilePath: /data-table/src/components/TimePickerField/index.vue
* @Description: 时间选择组件
-->
......@@ -62,6 +62,7 @@ const columns_type = ref([]);
const date_format = props.item.component_props.data_dateformat; // HH:mm=时分,HH:mm:ss=时分秒
onMounted(() => {
// 根据默认值时间调整显示
props.item.value = props.item.component_props.default;
currentTime.value = props.item.component_props.default ? props.item.component_props.default.split(":") : props.item.value.split(":");
let Hour = ''
let Minute = ''
......