Преглед изворни кода

日期范围支持添加多组

RuoYi пре 4 година
родитељ
комит
139b25639e
1 измењених фајлова са 22 додато и 20 уклоњено
  1. 22 20
      ruoyi-ui/src/utils/ruoyi.js

+ 22 - 20
ruoyi-ui/src/utils/ruoyi.js

@@ -58,7 +58,7 @@ export function addDateRange(params, dateRange, propName) {
58
 	var search = params;
58
 	var search = params;
59
 	search.params = {};
59
 	search.params = {};
60
 	if (null != dateRange && '' != dateRange) {
60
 	if (null != dateRange && '' != dateRange) {
61
-		if (typeof(propName) === "undefined") {
61
+		if (typeof (propName) === "undefined") {
62
 			search.params["beginTime"] = dateRange[0];
62
 			search.params["beginTime"] = dateRange[0];
63
 			search.params["endTime"] = dateRange[1];
63
 			search.params["endTime"] = dateRange[1];
64
 		} else {
64
 		} else {
@@ -87,8 +87,8 @@ export function selectDictLabels(datas, value, separator) {
87
 	var currentSeparator = undefined === separator ? "," : separator;
87
 	var currentSeparator = undefined === separator ? "," : separator;
88
 	var temp = value.split(currentSeparator);
88
 	var temp = value.split(currentSeparator);
89
 	Object.keys(value.split(currentSeparator)).some((val) => {
89
 	Object.keys(value.split(currentSeparator)).some((val) => {
90
-        Object.keys(datas).some((key) => {
91
-            if (datas[key].dictValue == ('' + temp[val])) {
90
+		Object.keys(datas).some((key) => {
91
+			if (datas[key].dictValue == ('' + temp[val])) {
92
 				actions.push(datas[key].dictLabel + currentSeparator);
92
 				actions.push(datas[key].dictLabel + currentSeparator);
93
 			}
93
 			}
94
 		})
94
 		})
@@ -179,21 +179,23 @@ export function handleTree(data, id, parentId, children) {
179
 * @param {*} params  参数
179
 * @param {*} params  参数
180
 */
180
 */
181
 export function tansParams(params) {
181
 export function tansParams(params) {
182
-    let result = ''
183
-    for (const propName of Object.keys(params)) {
184
-        const value = params[propName];
185
-        var part = encodeURIComponent(propName) + "=";
186
-        if (value !== null && typeof(value) !== "undefined") {
187
-            if (typeof value === 'object') {
188
-                for (const key of Object.keys(value)) {
189
-                    let params = propName + '[' + key + ']';
190
-                    var subPart = encodeURIComponent(params) + "=";
191
-                    result += subPart + encodeURIComponent(value[key]) + "&";
192
-                }
193
-            } else {
194
-                result += part + encodeURIComponent(value) + "&";
195
-           }
196
-        }
197
-    }
198
-    return result
182
+	let result = ''
183
+	for (const propName of Object.keys(params)) {
184
+		const value = params[propName];
185
+		var part = encodeURIComponent(propName) + "=";
186
+		if (value !== null && typeof (value) !== "undefined") {
187
+			if (typeof value === 'object') {
188
+				for (const key of Object.keys(value)) {
189
+					if (value[key] !== null && typeof (value[key]) !== 'undefined') {
190
+						let params = propName + '[' + key + ']';
191
+						var subPart = encodeURIComponent(params) + "=";
192
+						result += subPart + encodeURIComponent(value[key]) + "&";
193
+					}
194
+				}
195
+			} else {
196
+				result += part + encodeURIComponent(value) + "&";
197
+			}
198
+		}
199
+	}
200
+	return result
199
 }
201
 }