@netang/quasar 0.2.34 → 0.2.37
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 +1 -1
- package/sass/quasar/field.scss +1 -1
- package/utils/useSearch.js +32 -14
package/package.json
CHANGED
package/sass/quasar/field.scss
CHANGED
package/utils/useSearch.js
CHANGED
|
@@ -136,25 +136,29 @@ export function setItemValue(value, val) {
|
|
|
136
136
|
|
|
137
137
|
// 如果值为数组
|
|
138
138
|
if (Array.isArray(val)) {
|
|
139
|
-
// 比较类型为 in
|
|
140
|
-
value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
|
|
141
|
-
// 设置值为将数组转为逗号分隔的字符串
|
|
142
|
-
value[0].value = $n_join(val, ',')
|
|
143
139
|
|
|
144
|
-
// 如果值是逗号隔开
|
|
145
|
-
} else if ($n_split(val, ',').length > 1) {
|
|
146
140
|
// 比较类型为 in
|
|
147
141
|
value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
|
|
148
|
-
// 设置值为将数组转为逗号分隔的字符串
|
|
149
|
-
value[0].value = val
|
|
150
142
|
|
|
151
|
-
// 否则为单个值
|
|
152
143
|
} else {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
|
|
145
|
+
// 如果值是逗号隔开
|
|
146
|
+
const arr = $n_split(val, ',')
|
|
147
|
+
if (arr.length > 1) {
|
|
148
|
+
// 比较类型为 in
|
|
149
|
+
value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
|
|
150
|
+
val = arr
|
|
151
|
+
|
|
152
|
+
// 否则为单个值
|
|
153
|
+
} else {
|
|
154
|
+
|
|
155
|
+
// 比较类型为 ==
|
|
156
|
+
value[0].compare = dicts.SEARCH_COMPARE_TYPE__EQUAL
|
|
157
|
+
}
|
|
157
158
|
}
|
|
159
|
+
|
|
160
|
+
// 设置值为当前值
|
|
161
|
+
value[0].value = $n_numberDeep(val)
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
/**
|
|
@@ -278,14 +282,28 @@ export function getRawData(tableColumns, query, searchFromQuery = true) {
|
|
|
278
282
|
newVal = decodeURIComponent(newVal)
|
|
279
283
|
if ($n_isJson(newVal)) {
|
|
280
284
|
$n_forEach($n_json.parse(newVal), function (v, i) {
|
|
285
|
+
|
|
281
286
|
if (
|
|
282
287
|
i <= 1
|
|
283
288
|
&& $n_isValidArray(v)
|
|
284
289
|
&& v.length >= 2
|
|
285
290
|
) {
|
|
291
|
+
let newVal = v[1]
|
|
292
|
+
|
|
293
|
+
// 如果比较类型为 in / not in
|
|
294
|
+
if ($n_indexOf([ dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN ], v[0]) > -1) {
|
|
295
|
+
// 如果不为数组
|
|
296
|
+
if (! Array.isArray(v[1])) {
|
|
297
|
+
newVal = $n_split(newVal, ',')
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
} else if (! $n_isRequired(newVal)) {
|
|
301
|
+
newVal = ''
|
|
302
|
+
}
|
|
303
|
+
|
|
286
304
|
value[i] = {
|
|
287
305
|
compare: v[0],
|
|
288
|
-
value: $
|
|
306
|
+
value: $n_numberDeep(newVal),
|
|
289
307
|
}
|
|
290
308
|
}
|
|
291
309
|
})
|