hookehuyr

fix

1 <!-- 1 <!--
2 * @Date: 2022-08-31 11:45:30 2 * @Date: 2022-08-31 11:45:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 14:30:42 4 + * @LastEditTime: 2024-06-13 15:54:10
5 * @FilePath: /data-table/src/components/DatePickerField/index.vue 5 * @FilePath: /data-table/src/components/DatePickerField/index.vue
6 * @Description: 日期选择组件 6 * @Description: 日期选择组件
7 --> 7 -->
...@@ -76,7 +76,7 @@ const maxDate = ref() ...@@ -76,7 +76,7 @@ const maxDate = ref()
76 onMounted(() => { 76 onMounted(() => {
77 // 根据默认值时间调整显示 77 // 根据默认值时间调整显示
78 props.item.value = props.item.component_props.default; 78 props.item.value = props.item.component_props.default;
79 - currentDate.value = props.item.component_props.default ? props.item.component_props.default.split("-") : props.item.value.split("-"); 79 + currentDate.value = props.item.component_props.default ? props.item.component_props.default.split("-") : props.item.value?.split("-");
80 let Year = ''; 80 let Year = '';
81 let Month = ''; 81 let Month = '';
82 let Day = ''; 82 let Day = '';
......
1 <!-- 1 <!--
2 * @Date: 2022-09-08 15:02:45 2 * @Date: 2022-09-08 15:02:45
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 14:32:20 4 + * @LastEditTime: 2024-06-13 15:56:40
5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue 5 * @FilePath: /data-table/src/components/DateTimePickerField/index.vue
6 * @Description: 日期时间选择器 6 * @Description: 日期时间选择器
7 --> 7 -->
...@@ -82,7 +82,7 @@ const maxDate = ref() ...@@ -82,7 +82,7 @@ const maxDate = ref()
82 onMounted(() => { 82 onMounted(() => {
83 // 根据默认值时间调整显示 83 // 根据默认值时间调整显示
84 props.item.value = props.item.component_props.default; 84 props.item.value = props.item.component_props.default;
85 - const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value.split(" "); 85 + const datetime = props.item.component_props.default ? props.item.component_props.default.split(" ") : props.item.value?.split(" ");
86 currentDate.value = datetime[0]?.split("-"); 86 currentDate.value = datetime[0]?.split("-");
87 currentTime.value = datetime[1]?.split(":"); 87 currentTime.value = datetime[1]?.split(":");
88 // YYYY=年,YYYY-MM=年月,YYYY-MM-DD=年月日,YYYY-MM-DD HH=年月日时,YYYY-MM-DD HH:mm=年月日时分,YYYY-MM-DD HH:mm:ss=年月日时分秒 88 // YYYY=年,YYYY-MM=年月,YYYY-MM-DD=年月日,YYYY-MM-DD HH=年月日时,YYYY-MM-DD HH:mm=年月日时分,YYYY-MM-DD HH:mm:ss=年月日时分秒
......
1 <!-- 1 <!--
2 * @Date: 2022-08-31 11:45:30 2 * @Date: 2022-08-31 11:45:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-13 14:33:24 4 + * @LastEditTime: 2024-06-13 15:54:33
5 * @FilePath: /data-table/src/components/TimePickerField/index.vue 5 * @FilePath: /data-table/src/components/TimePickerField/index.vue
6 * @Description: 时间选择组件 6 * @Description: 时间选择组件
7 --> 7 -->
...@@ -63,7 +63,7 @@ const date_format = props.item.component_props.data_dateformat; // HH:mm=时分ï ...@@ -63,7 +63,7 @@ const date_format = props.item.component_props.data_dateformat; // HH:mm=时分ï
63 onMounted(() => { 63 onMounted(() => {
64 // 根据默认值时间调整显示 64 // 根据默认值时间调整显示
65 props.item.value = props.item.component_props.default; 65 props.item.value = props.item.component_props.default;
66 - currentTime.value = props.item.component_props.default ? props.item.component_props.default.split(":") : props.item.value.split(":"); 66 + currentTime.value = props.item.component_props.default ? props.item.component_props.default.split(":") : props.item.value?.split(":");
67 let Hour = '' 67 let Hour = ''
68 let Minute = '' 68 let Minute = ''
69 let Second = '' 69 let Second = ''
......