@netang/quasar 0.2.31 → 0.2.33
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/$power.js +3 -1
- package/utils/$table.js +3 -0
- package/utils/useSearch.js +29 -4
package/package.json
CHANGED
package/utils/$power.js
CHANGED
|
@@ -1418,7 +1418,7 @@ function getPageData($route) {
|
|
|
1418
1418
|
$route = $n_router.getRoute()
|
|
1419
1419
|
}
|
|
1420
1420
|
|
|
1421
|
-
|
|
1421
|
+
let path = $n_get($route, 'path')
|
|
1422
1422
|
if (! path) {
|
|
1423
1423
|
return $n_fail('路由参数错误')
|
|
1424
1424
|
}
|
|
@@ -1427,6 +1427,8 @@ function getPageData($route) {
|
|
|
1427
1427
|
return $n_fail('没有获取到权限数据')
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
|
+
path = $n_slash(path, 'start', true)
|
|
1431
|
+
|
|
1430
1432
|
// 获取角色数据
|
|
1431
1433
|
const { urls, btns } = $n_cloneDeep(statePower.value)
|
|
1432
1434
|
if (! $n_has(urls, path)) {
|
package/utils/$table.js
CHANGED
|
@@ -378,6 +378,9 @@ function create(options) {
|
|
|
378
378
|
|
|
379
379
|
// 获取原始数据
|
|
380
380
|
const r = getRawData(_tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
|
|
381
|
+
|
|
382
|
+
console.log('-----r', $n.cloneDeep(r.firstTableSearchValue))
|
|
383
|
+
|
|
381
384
|
// 原始参数
|
|
382
385
|
rawQuery = r.rawQuery
|
|
383
386
|
// 原始表格搜索参数
|
package/utils/useSearch.js
CHANGED
|
@@ -6,15 +6,17 @@ import $n_isFunction from 'lodash/isFunction'
|
|
|
6
6
|
import $n_findIndex from 'lodash/findIndex'
|
|
7
7
|
|
|
8
8
|
import $n_forEach from '@netang/utils/forEach'
|
|
9
|
-
import $n_isValidArray from '@netang/utils/isValidArray'
|
|
10
9
|
import $n_join from '@netang/utils/join'
|
|
11
10
|
import $n_split from '@netang/utils/split'
|
|
11
|
+
import $n_isJson from '@netang/utils/isJson'
|
|
12
|
+
import $n_json from '@netang/utils/json'
|
|
12
13
|
import $n_indexOf from '@netang/utils/indexOf'
|
|
13
14
|
|
|
14
15
|
import $n_isRequired from '@netang/utils/isRequired'
|
|
15
16
|
import $n_forIn from '@netang/utils/forIn'
|
|
16
17
|
import $n_runAsync from '@netang/utils/runAsync'
|
|
17
18
|
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
19
|
+
import $n_isValidArray from '@netang/utils/isValidArray'
|
|
18
20
|
import $n_isValidValue from '@netang/utils/isValidValue'
|
|
19
21
|
import $n_trimString from '@netang/utils/trimString'
|
|
20
22
|
import $n_numberDeep from '@netang/utils/numberDeep'
|
|
@@ -195,6 +197,9 @@ function formatItemValueCompare(value, { compareOptions1 }) {
|
|
|
195
197
|
*/
|
|
196
198
|
export function getRawData(tableColumns, query, searchFromQuery = true) {
|
|
197
199
|
|
|
200
|
+
|
|
201
|
+
console.log('-----query', $n.cloneDeep(query))
|
|
202
|
+
|
|
198
203
|
// 原始参数
|
|
199
204
|
const rawQuery = {}
|
|
200
205
|
// 原始表格搜索参数
|
|
@@ -268,10 +273,30 @@ export function getRawData(tableColumns, query, searchFromQuery = true) {
|
|
|
268
273
|
// 如果在传参中有搜索参数
|
|
269
274
|
&& $n_has(query, newItem.name)
|
|
270
275
|
) {
|
|
276
|
+
let newVal = query[newItem.name]
|
|
277
|
+
|
|
271
278
|
// 如果有值
|
|
272
|
-
if ($n_isRequired(
|
|
273
|
-
|
|
274
|
-
|
|
279
|
+
if ($n_isRequired(newVal)) {
|
|
280
|
+
|
|
281
|
+
newVal = decodeURIComponent(newVal)
|
|
282
|
+
if ($n_isJson(newVal)) {
|
|
283
|
+
$n_forEach($n_json.parse(newVal), function (v, i) {
|
|
284
|
+
if (
|
|
285
|
+
i <= 1
|
|
286
|
+
&& $n_isValidArray(v)
|
|
287
|
+
&& v.length >= 2
|
|
288
|
+
) {
|
|
289
|
+
value[i] = {
|
|
290
|
+
compare: v[0],
|
|
291
|
+
value: $n_isRequired(v[1]) ? v[1] : '',
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
} else {
|
|
297
|
+
// 设置单个搜索值
|
|
298
|
+
setItemValue(value, newVal)
|
|
299
|
+
}
|
|
275
300
|
}
|
|
276
301
|
|
|
277
302
|
// 设置参数中搜索的 key
|