safecheck-client 4.0.1-89 → 4.0.1-90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "safecheck-client",
3
3
  "//": "主分支版本别乱升,测试包的版本直接发包(建议使用1.XX.XX-XXX格式作为测试包,不要频繁升级第三位版本号),别提交版本号。切了分支切记把主分支版本升了,保证主分支始终是最高版本!!!!!",
4
- "version": "4.0.1-89",
4
+ "version": "4.0.1-90",
5
5
  "description": "安检模块 前端组件",
6
6
  "author": "丁新 <417755458@qq.com>",
7
7
  "license": "ISC",
@@ -598,20 +598,26 @@ export default {
598
598
  },
599
599
  methods: {
600
600
  formatDateTime(date) {
601
- if(isEmpty(date)){
602
- return ''
601
+ if (isEmpty(date)) {
602
+ return '';
603
603
  }
604
- // 解析输入的时间字符串,格式如 "10 21 2022 2:46PM"
605
- // 分割字符串获取各个部分
606
- const parts = date.split(' ');
607
- const month = parts[0]; // 月份
608
- const day = parts[1]; // 日期
609
- const year = parts[2]; // 年份
610
- const timePart = parts[3]; // 时间部分(包含上下午)
604
+
605
+ // 使用正则表达式分割多个空格
606
+ const parts = date.trim().split(/\s+/);
607
+
608
+ // 检查是否有足够的部分
609
+ if (parts.length < 4) {
610
+ console.warn('Invalid date format:', date);
611
+ return ''; // 或者返回原始值或者默认值
612
+ }
613
+
614
+ let [month, day, year, timePart] = parts;
615
+
611
616
  // 处理月份和日期,确保是两位数格式
612
617
  const formattedMonth = month.padStart(2, '0');
613
618
  const formattedDay = day.padStart(2, '0');
614
- // 组合成 yyyy-mm-dd 格式
619
+
620
+ // 返回格式化后的日期(不需要时间)
615
621
  return `${year}-${formattedMonth}-${formattedDay}`;
616
622
  },
617
623
  scan(){