From 892065003d2c43b8d32c152aa0da2b9518e1fb2f Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 29 Jul 2021 10:38:34 +0800
Subject: [PATCH] 修复导出含params属性对象参数问题
---
ruoyi-ui/src/utils/ruoyi.js | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index dd5ef15..f60701e 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -58,7 +58,7 @@
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
- if (typeof (propName) === "undefined") {
+ if (typeof(propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
@@ -87,8 +87,8 @@
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
- Object.keys(datas).some((key) => {
- if (datas[key].dictValue == ('' + temp[val])) {
+ Object.keys(datas).some((key) => {
+ if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
@@ -173,3 +173,27 @@
}
return tree;
}
+
+/**
+* 参数处理
+* @param {*} params 参数
+*/
+export function tansParams(params) {
+ let result = ''
+ for (const propName of Object.keys(params)) {
+ const value = params[propName];
+ var part = encodeURIComponent(propName) + "=";
+ if (value !== null && typeof(value) !== "undefined") {
+ if (typeof value === 'object') {
+ for (const key of Object.keys(value)) {
+ let params = propName + '[' + key + ']';
+ var subPart = encodeURIComponent(params) + "=";
+ result += subPart + encodeURIComponent(value[key]) + "&";
+ }
+ } else {
+ result += part + encodeURIComponent(value) + "&";
+ }
+ }
+ }
+ return result
+}
--
Gitblit v1.9.3