Ver código fonte

:bug: fix the bug of date-fns component

tycoding 8 meses atrás
pai
commit
74b7011e72

+ 1 - 1
langchat-ui/langchat-ui-client/src/utils/dateUtil.ts

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-import { format } from 'date-fns';
+import format from 'date-fns/format';
 
 const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
 const DATE_FORMAT = 'yyyy-MM-dd ';

+ 6 - 7
langchat-ui/langchat-ui-server/src/components/Table/src/components/editable/EditableCell.vue

@@ -33,11 +33,10 @@
 </template>
 <script lang="ts">
   import type { PropType } from 'vue';
+  import { computed, defineComponent, nextTick, ref, toRaw, unref, watchEffect } from 'vue';
   import type { BasicColumn } from '../../types/table';
   import type { EditRecordRow } from './index';
-
-  import { defineComponent, ref, unref, nextTick, computed, watchEffect, toRaw } from 'vue';
-  import { FormOutlined, CloseOutlined, CheckOutlined } from '@vicons/antd';
+  import { CheckOutlined, CloseOutlined, FormOutlined } from '@vicons/antd';
   import { CellComponent } from './CellComponent';
 
   import { useTableContext } from '../../hooks/useTableContext';
@@ -45,12 +44,12 @@
   import clickOutside from '@/directives/clickOutside';
 
   import { propTypes } from '@/utils/propTypes';
-  import { isString, isBoolean, isFunction, isNumber, isArray } from '@/utils/is';
+  import { isArray, isBoolean, isFunction, isNumber, isString } from '@/utils/is';
   import { createPlaceholderMessage } from './helper';
-  import { set, omit } from 'lodash-es';
+  import { omit, set } from 'lodash-es';
   import { EventEnum } from '@/components/Table/src/componentMap';
-
-  import { parseISO, format } from 'date-fns';
+  import format from 'date-fns/format';
+  import parseISO from 'date-fns/parseISO';
 
   export default defineComponent({
     name: 'EditableCell',

+ 1 - 1
langchat-ui/langchat-ui-server/src/utils/dateUtil.ts

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-import { format } from 'date-fns';
+import format from 'date-fns/format';
 
 const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
 const DATE_FORMAT = 'yyyy-MM-dd ';