From 9d1118385fcb60a4b9e3d9eddd95ae97a82dd4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 26 May 2022 12:50:28 +0800 Subject: [PATCH] update index.js --- src/utils/index.js | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index f3b2a69..1ce9beb 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,20 +1,5 @@ import { parseTime } from './ruoyi' -/** - * 表格时间格式化 - */ -export function formatDate(cellValue) { - if (cellValue == null || cellValue == "") return ""; - var date = new Date(cellValue) - var year = date.getFullYear() - var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 - var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() - var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() - var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() - var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() - return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds -} - /** * @param {number} time * @param {string} option @@ -77,22 +62,6 @@ export function getQueryObject(url) { return obj } -/** - * @param {string} input value - * @returns {number} output value - */ -export function byteLength(str) { - // returns the byte length of an utf8 string - let s = str.length - for (var i = str.length - 1; i >= 0; i--) { - const code = str.charCodeAt(i) - if (code > 0x7f && code <= 0x7ff) s++ - else if (code > 0x7ff && code <= 0xffff) s += 2 - if (code >= 0xDC00 && code <= 0xDFFF) i-- - } - return s -} - /** * 清空数组 * @param {Array} actual