From 662dec2fe2f57d9f35c8effd2b7292e3eee92fc3 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Mon, 25 Oct 2021 10:29:27 +0800
Subject: [PATCH] 修正错别字
---
ruoyi-ui/src/utils/ruoyi.js | 33 ++++++++++++++++++++++++++++++---
1 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index ce7253a..8d5bfc6 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -18,7 +18,7 @@
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
- time = time.replace(new RegExp(/-/gm), '/');
+ time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
@@ -72,8 +72,8 @@
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
- if (datas[key].dictValue == ('' + value)) {
- actions.push(datas[key].dictLabel);
+ if (datas[key].value == ('' + value)) {
+ actions.push(datas[key].label);
return true;
}
})
@@ -121,6 +121,22 @@
}
return str;
}
+
+// 数据合并
+export function mergeRecursive(source, target) {
+ for (var p in target) {
+ try {
+ if (target[p].constructor == Object) {
+ source[p] = mergeRecursive(source[p], target[p]);
+ } else {
+ source[p] = target[p];
+ }
+ } catch(e) {
+ source[p] = target[p];
+ }
+ }
+ return source;
+};
/**
* 构造树型结构数据
@@ -198,3 +214,14 @@
}
return result
}
+
+// 验证是否为blob格式
+export async function blobValidate(data) {
+ try {
+ const text = await data.text();
+ JSON.parse(text);
+ return false;
+ } catch (error) {
+ return true;
+ }
+}
--
Gitblit v1.9.3