@netang/quasar 0.1.14 → 0.1.15
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/utils/$table.js +3 -0
- package/utils/useSearch.js +8 -2
package/package.json
CHANGED
package/utils/$table.js
CHANGED
|
@@ -679,8 +679,11 @@ function create(options) {
|
|
|
679
679
|
}
|
|
680
680
|
})
|
|
681
681
|
|
|
682
|
+
console.log('tableSearchValue.value', tableSearchValue.value)
|
|
683
|
+
|
|
682
684
|
// 获取搜索值
|
|
683
685
|
const search = formatValue(rawSearchOptions, tableSearchValue.value)
|
|
686
|
+
console.log('search', search)
|
|
684
687
|
if ($n_isValidArray(search)) {
|
|
685
688
|
data.n_search = $n_has(data, 'n_search') ? $n_concat(data.n_search, search) : search
|
|
686
689
|
}
|
package/utils/useSearch.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import $n_has from 'lodash/has'
|
|
2
|
+
import $n_isArray from 'lodash/isArray'
|
|
2
3
|
import $n_cloneDeep from 'lodash/cloneDeep'
|
|
3
4
|
import $n_merge from 'lodash/merge'
|
|
4
5
|
import $n_isFunction from 'lodash/isFunction'
|
|
@@ -18,6 +19,7 @@ import $n_isValidValue from '@netang/utils/isValidValue'
|
|
|
18
19
|
import $n_trimString from '@netang/utils/trimString'
|
|
19
20
|
import $n_numberDeep from '@netang/utils/numberDeep'
|
|
20
21
|
import $n_toDate from '@netang/utils/toDate'
|
|
22
|
+
import $n_replaceAll from '@netang/utils/replaceAll'
|
|
21
23
|
|
|
22
24
|
import { date as quasarDate } from 'quasar'
|
|
23
25
|
import { getQuickRange, quickRange } from '../components/field-date/methods'
|
|
@@ -399,17 +401,21 @@ export function formatValue(rawSearchOptions, searchValue) {
|
|
|
399
401
|
function addValue1(value1) {
|
|
400
402
|
|
|
401
403
|
// 如果有值1
|
|
402
|
-
if ($
|
|
404
|
+
if ($n_isRequired(value1.value)) {
|
|
403
405
|
|
|
404
406
|
// 如果值1 类型为 in / not in
|
|
405
407
|
if ($n_indexOf([dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN], value1.compare) > -1) {
|
|
408
|
+
|
|
406
409
|
const vals = []
|
|
407
|
-
|
|
410
|
+
|
|
411
|
+
const values = $n_isArray(value1.value) ? value1.value : $n_split($n_replaceAll($n_trimString(value1.value), ',', ','), ',')
|
|
412
|
+
$n_forEach(values, function (item) {
|
|
408
413
|
item = $n_numberDeep(item)
|
|
409
414
|
if ($n_isValidValue(item)) {
|
|
410
415
|
vals.push(item)
|
|
411
416
|
}
|
|
412
417
|
})
|
|
418
|
+
|
|
413
419
|
if (vals.length) {
|
|
414
420
|
lists.push({
|
|
415
421
|
field: name,
|