@netang/quasar 0.0.53 → 0.0.55

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.
Files changed (115) hide show
  1. package/_docs/docs/.vuepress/client.js +39 -0
  2. package/_docs/docs/.vuepress/components/test.vue +23 -0
  3. package/_docs/docs/.vuepress/config.js +40 -0
  4. package/_docs/docs/.vuepress/configs/index.js +2 -0
  5. package/_docs/docs/.vuepress/configs/navbar/index.js +1 -0
  6. package/_docs/docs/.vuepress/configs/navbar/zh.js +16 -0
  7. package/_docs/docs/.vuepress/configs/sidebar/index.js +1 -0
  8. package/_docs/docs/.vuepress/configs/sidebar/zh.js +20 -0
  9. package/_docs/docs/.vuepress/public/css/index.css +3 -0
  10. package/_docs/docs/.vuepress/styles/index.scss +3 -0
  11. package/_docs/docs/components/field-table.md +63 -0
  12. package/_docs/docs/components/field-tree.md +1 -0
  13. package/{docs → _docs}/docs/index.md +0 -0
  14. package/{docs → _docs}/docs/utils/alert.md +0 -0
  15. package/{docs → _docs}/docs/utils/confirm.md +0 -0
  16. package/_docs/docs/utils/index.md +1 -0
  17. package/_docs/package.json +17 -0
  18. package/components/column-title/index.vue +2 -2
  19. package/components/data/index.vue +20 -23
  20. package/components/dialog/index.vue +26 -12
  21. package/components/dialog-table/index.vue +4 -2
  22. package/components/dragger/index.vue +3 -2
  23. package/components/drawer/index.vue +16 -9
  24. package/components/editor-code/index.vue +12 -5
  25. package/components/empty/index.vue +16 -1
  26. package/components/field-date/index.vue +48 -36
  27. package/components/field-table/index.vue +69 -43
  28. package/components/field-text/index.vue +6 -2
  29. package/components/field-tree/index.vue +40 -22
  30. package/components/input-number/index.vue +5 -4
  31. package/components/list-menu/index.vue +14 -2
  32. package/components/power-page/index.vue +10 -0
  33. package/components/private/components/index.js +7 -2
  34. package/components/private/components/move-to-tree/index.vue +7 -3
  35. package/components/private/edit-power-data/index.vue +92 -52
  36. package/components/private/table-visible-columns-button/index.vue +6 -2
  37. package/components/render/index.vue +21 -7
  38. package/components/search/index.vue +30 -2
  39. package/components/search-item/index.vue +24 -8
  40. package/components/select/index.vue +5 -2
  41. package/components/splitter/index.vue +13 -9
  42. package/components/table/index.vue +32 -5
  43. package/components/table-pagination/index.vue +0 -1
  44. package/components/table-splitter/index.vue +22 -3
  45. package/components/table-summary/index.vue +10 -3
  46. package/components/thumbnail/index.vue +16 -6
  47. package/components/toolbar/index.vue +0 -2
  48. package/components/uploader/index.vue +5 -2
  49. package/components/uploader-query/index.vue +48 -27
  50. package/components/value-format/index.vue +19 -12
  51. package/configs/area3.js +1 -0
  52. package/docs/404.html +33 -0
  53. package/docs/assets/404.html-60b35caa.js +1 -0
  54. package/docs/assets/404.html-d1e63d77.js +1 -0
  55. package/docs/assets/alert.html-568d4e94.js +1 -0
  56. package/docs/assets/alert.html-f5dbc3e9.js +1 -0
  57. package/docs/assets/app-8c3ae4de.js +6 -0
  58. package/docs/assets/back-to-top-8efcbe56.svg +1 -0
  59. package/docs/assets/confirm.html-7a1566f6.js +1 -0
  60. package/docs/assets/confirm.html-96f1b004.js +1 -0
  61. package/docs/assets/field-table.html-68d610b0.js +1 -0
  62. package/docs/assets/field-table.html-86cc3511.js +1 -0
  63. package/docs/assets/field-tree.html-45410c3c.js +1 -0
  64. package/docs/assets/field-tree.html-c98ac993.js +1 -0
  65. package/docs/assets/framework-204010b2.js +5 -0
  66. package/docs/assets/index.html-1695dd7c.js +1 -0
  67. package/docs/assets/index.html-65a4aa67.js +1 -0
  68. package/docs/assets/style-ac5a9aa6.css +1 -0
  69. package/docs/components/field-table.html +33 -0
  70. package/docs/components/field-tree.html +33 -0
  71. package/docs/index.html +33 -0
  72. package/docs/utils/alert.html +33 -0
  73. package/docs/utils/confirm.html +33 -0
  74. package/package.json +1 -1
  75. package/package2.json +30 -0
  76. package/store/index.js +3 -20
  77. package/utils/alert.js +3 -1
  78. package/utils/area.js +27 -14
  79. package/utils/arr.js +6 -2
  80. package/utils/auth.js +40 -35
  81. package/utils/bus.js +1 -1
  82. package/utils/config.js +42 -15
  83. package/utils/{confrim.js → confirm.js} +1 -1
  84. package/utils/copy.js +18 -0
  85. package/utils/dialog.js +7 -3
  86. package/utils/dict.js +5 -28
  87. package/utils/dictOptions.js +24 -0
  88. package/utils/form.js +6 -2
  89. package/utils/getData.js +21 -9
  90. package/utils/getFile.js +11 -5
  91. package/utils/getImage.js +23 -12
  92. package/utils/getTime.js +9 -4
  93. package/utils/index.js +61 -0
  94. package/utils/loading.js +3 -1
  95. package/utils/notify.js +1 -1
  96. package/utils/power.js +164 -118
  97. package/utils/previewImage.js +4 -2
  98. package/utils/price.js +12 -3
  99. package/utils/rule.js +5 -9
  100. package/utils/ruleValid.js +10 -0
  101. package/utils/search.js +81 -50
  102. package/utils/table.js +119 -87
  103. package/utils/timestamp.js +2 -2
  104. package/utils/toast.js +1 -1
  105. package/utils/tree.js +69 -46
  106. package/utils/uploader/qiniu.js +31 -15
  107. package/utils/uploader.js +87 -56
  108. package/utils/useAuth.js +12 -5
  109. package/utils/useRouter.js +16 -5
  110. package/utils/useUploader.js +0 -5
  111. package/docs/docs/.vuepress/config.js +0 -32
  112. package/docs/docs/components/field-table.md +0 -1
  113. package/docs/docs/components/field-tree.md +0 -1
  114. package/docs/package.json +0 -11
  115. package/utils/http.js +0 -251
package/utils/table.js CHANGED
@@ -1,16 +1,47 @@
1
1
  import { ref, computed, provide, inject, watch } from 'vue'
2
2
  import { date, useQuasar } from 'quasar'
3
3
 
4
- // 表格配置
5
- import tablesConfig from '@/tables'
6
-
7
- import {
8
- // 设置单个搜索值
9
- setItemValue,
10
- } from './$search'
4
+ import $n_has from 'lodash/has'
5
+ import $n_get from 'lodash/get'
6
+ import $n_cloneDeep from 'lodash/cloneDeep'
7
+ import $n_merge from 'lodash/merge'
8
+ import $n_isFunction from 'lodash/isFunction'
9
+ import $n_findIndex from 'lodash/findIndex'
10
+ import $n_uniq from 'lodash/uniq'
11
+ import $n_concat from 'lodash/concat'
12
+ import $n_isNil from 'lodash/isNil'
13
+
14
+ import $n_router from '@netang/vue-utils/router'
15
+
16
+ import $n_forEach from '@netang/utils/forEach'
17
+ import $n_isValidArray from '@netang/utils/isValidArray'
18
+ import $n_isValidString from '@netang/utils/isValidString'
19
+ import $n_indexOf from '@netang/utils/indexOf'
20
+ import $n_storage from '@netang/utils/storage'
21
+
22
+ import $n_isRequired from '@netang/utils/isRequired'
23
+ import $n_forIn from '@netang/utils/forIn'
24
+ import $n_runAsync from '@netang/utils/runAsync'
25
+ import $n_isValidObject from '@netang/utils/isValidObject'
26
+ import $n_isValidValue from '@netang/utils/isValidValue'
27
+ import $n_toDate from '@netang/utils/toDate'
28
+ import $n_slash from '@netang/utils/slash'
29
+ import $n_http from '@netang/utils/http'
30
+
31
+ import $n_search, { setItemValue } from './search'
32
+ import $n_power from './power'
33
+ import $n_dict from './dict'
34
+ import $n_price from './price'
35
+
36
+ import { configs } from './config'
11
37
 
12
38
  import { NRenderKey, NPowerKey, NTableKey } from './symbols'
13
39
 
40
+ const {
41
+ // 表格配置
42
+ tablesConfig,
43
+ } = configs
44
+
14
45
  /**
15
46
  * 创建表格
16
47
  */
@@ -23,10 +54,9 @@ function create(params) {
23
54
 
24
55
  // 每页显示行数选项
25
56
  const rowsPerPageOptions = [30, 40, 50, 100, 200, 500, 1000]
26
- // const rowsPerPageOptions = [3, 40, 50, 100, 200, 500, 1000]
27
57
 
28
58
  // 获取参数
29
- const o = $n.merge({
59
+ const o = $n_merge({
30
60
  // 路由路径
31
61
  path: '',
32
62
  // 路由参数
@@ -98,21 +128,21 @@ function create(params) {
98
128
  // 如果有渲染注入
99
129
  if (!! $render) {
100
130
  // 如果有表格传参, 则合并参数
101
- const tableProps = $n.get($render, 'props.tableProps')
102
- if ($n.isValidObject(tableProps)) {
103
- $n.merge(o, tableProps)
131
+ const tableProps = $n_get($render, 'props.tableProps')
132
+ if ($n_isValidObject(tableProps)) {
133
+ $n_merge(o, tableProps)
104
134
  }
105
135
  }
106
136
 
107
137
  // 获取权限注入
108
- const $power = $n.has(params, '$power') ? params.$power : inject(NPowerKey)
138
+ const $power = $n_has(params, '$power') ? params.$power : inject(NPowerKey)
109
139
  const hasPowr = !! $power
110
140
 
111
141
  // 获取选择类型(默认 single)
112
- if (! $n.has(o, 'selection') || ! $n.isValidString(o.selection)) {
142
+ if (! $n_has(o, 'selection') || ! $n_isValidString(o.selection)) {
113
143
  if (hasPowr) {
114
- o.selection = $n.get($power, 'powerPage.data.selection')
115
- if (! $n.isValidString(o.selection)) {
144
+ o.selection = $n_get($power, 'powerPage.data.selection')
145
+ if (! $n_isValidString(o.selection)) {
116
146
  o.selection = 'single'
117
147
  }
118
148
  } else {
@@ -121,21 +151,21 @@ function create(params) {
121
151
  }
122
152
 
123
153
  // 获取权限路由
124
- const $route = $n.isValidString(o.path) ?
154
+ const $route = $n_isValidString(o.path) ?
125
155
  // 如果为自定义路由
126
- $n.router.resolve({
156
+ $n_router.resolve({
127
157
  path: o.path,
128
- query: $n.isValidObject(o.query) ? o.query : {},
158
+ query: $n_isValidObject(o.query) ? o.query : {},
129
159
  })
130
160
  // 否则获取当前路由
131
- : (hasPowr ? $power.getRoute() : $n.router.getRoute())
161
+ : (hasPowr ? $power.getRoute() : $n_router.getRoute())
132
162
 
133
163
  // 是否有权限按钮
134
164
  const hasPowerBtns = hasPowr ? $power.powerBtns.value.length : false
135
165
 
136
166
  // 表格已选数据
137
167
  const tableSelected = hasPowr ? $power.tableSelected : ref([])
138
- if ($n.isValidArray(o.selected)) {
168
+ if ($n_isValidArray(o.selected)) {
139
169
  tableSelected.value = o.selected
140
170
  }
141
171
 
@@ -143,7 +173,7 @@ function create(params) {
143
173
  const isCache = !! o.cache
144
174
 
145
175
  // 缓存名
146
- const cacheName = $route.fullPath ? $route.fullPath : ($n.isValidString(o.cache) ? o.cache : '')
176
+ const cacheName = $route.fullPath ? $route.fullPath : ($n_isValidString(o.cache) ? o.cache : '')
147
177
 
148
178
  // 表格列
149
179
  const tableColumns = []
@@ -161,48 +191,48 @@ function create(params) {
161
191
  const tableImgNames = ref([])
162
192
 
163
193
  // 设置列参数
164
- $n.forEach(o.columns, function(item) {
194
+ $n_forEach(o.columns, function(item) {
165
195
 
166
196
  if (
167
- ! $n.has(item, 'field')
168
- && $n.has(item, 'name')
197
+ ! $n_has(item, 'field')
198
+ && $n_has(item, 'name')
169
199
  ) {
170
200
  item.field = item.name
171
201
  }
172
202
 
173
- if (! $n.has(item, 'align')) {
203
+ if (! $n_has(item, 'align')) {
174
204
  item.align = 'left'
175
205
  }
176
206
 
177
207
  // 是否隐藏
178
- item.hide = $n.get(item, 'hide') === true
208
+ item.hide = $n_get(item, 'hide') === true
179
209
 
180
210
  // 如果有显示项
181
- if ($n.get(item, 'visible') !== false) {
211
+ if ($n_get(item, 'visible') !== false) {
182
212
  o.visibleColumns.push(item.field)
183
213
  }
184
214
 
185
215
  // 如果有时间戳
186
- if ($n.has(item, 'time')) {
187
- item.format = val => date.formatDate($n.toDate(val), item.time === true ? `YYYY-MM-DD HH:mm` : item.time)
216
+ if ($n_has(item, 'time')) {
217
+ item.format = val => date.formatDate($n_toDate(val), item.time === true ? `YYYY-MM-DD HH:mm` : item.time)
188
218
 
189
219
  // 如果有数据字典
190
- } else if ($n.has(item, 'dict')) {
191
- item.format = val => $n.dict(item.dict, val)
220
+ } else if ($n_has(item, 'dict')) {
221
+ item.format = val => $n_dict(item.dict, val)
192
222
 
193
223
  // 如果有图片
194
- } else if ($n.has(item, 'img') && item.img === true) {
224
+ } else if ($n_has(item, 'img') && item.img === true) {
195
225
  tableImgNames.value.push(item.name)
196
226
 
197
227
  // 如果有价格
198
- } else if ($n.has(item, 'price')) {
199
- item.format = val => $n.price(val)
228
+ } else if ($n_has(item, 'price')) {
229
+ item.format = val => $n_price(val)
200
230
  }
201
231
 
202
232
  // 如果有路由
203
- if ($n.get(item, 'route')) {
233
+ if ($n_get(item, 'route')) {
204
234
  // 如果该值在当前路由路径中, 则显示
205
- if ($n.indexOf($route.fullPath, item.route) > -1) {
235
+ if ($n_indexOf($route.fullPath, item.route) > -1) {
206
236
  tableColumns.push(item)
207
237
  }
208
238
 
@@ -212,10 +242,10 @@ function create(params) {
212
242
  })
213
243
 
214
244
  // 获取可见列缓存
215
- const visibleColumnsCache = o.showVisibleColumns && isCache ? $n.storage.get('table:visible_columns:' + cacheName) : []
245
+ const visibleColumnsCache = o.showVisibleColumns && isCache ? $n_storage.get('table:visible_columns:' + cacheName) : []
216
246
 
217
247
  // 表格可见列
218
- const tableVisibleColumns = ref(Array.isArray(visibleColumnsCache) ? visibleColumnsCache : $n.uniq([...o.visibleColumns]))
248
+ const tableVisibleColumns = ref(Array.isArray(visibleColumnsCache) ? visibleColumnsCache : $n_uniq([...o.visibleColumns]))
219
249
 
220
250
  // 表格加载状态
221
251
  const tableLoading = ref(o.loading)
@@ -227,7 +257,7 @@ function create(params) {
227
257
  const tablePagination = ref($route.fullPath ? o.pagination : {})
228
258
 
229
259
  // 表格宫格
230
- const tableGrid = ref(o.showGrid && isCache ? $n.storage.get('table:grid:' + cacheName) === true : false)
260
+ const tableGrid = ref(o.showGrid && isCache ? $n_storage.get('table:grid:' + cacheName) === true : false)
231
261
 
232
262
  // 表格请求参数(将表格传参中的搜索参数剥离掉, 剩下的直接当做参数传递给服务器)
233
263
  let tableRequestQuery = {}
@@ -254,7 +284,7 @@ function create(params) {
254
284
  // 首次表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
255
285
  firstTableSearchValue,
256
286
  // 表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
257
- } = $n.search.getRawData(tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
287
+ } = $n_search.getRawData(tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
258
288
 
259
289
  // 表格搜索数据值
260
290
  const tableSearchValue = ref($route.fullPath ? firstTableSearchValue : [])
@@ -275,7 +305,7 @@ function create(params) {
275
305
  const lists = []
276
306
 
277
307
  // 先格式化权限按钮列表
278
- $n.forEach($n.power.formatBtns($power.powerBtns.value), function(item) {
308
+ $n_forEach($n_power.formatBtns($power.powerBtns.value), function(item) {
279
309
 
280
310
  // 如果是固定按钮
281
311
  if (item.fixed) {
@@ -294,10 +324,10 @@ function create(params) {
294
324
  // 非手机模式
295
325
  ! $q.platform.is.mobile
296
326
  // 有权限列表
297
- && $n.isValidArray($power.powerBtns.value)
327
+ && $n_isValidArray($power.powerBtns.value)
298
328
  ) {
299
329
  for (const item of $power.powerBtns.value) {
300
- if ($n.has(item, 'data.dbclick') === true) {
330
+ if ($n_has(item, 'data.dbclick') === true) {
301
331
  return item
302
332
  }
303
333
  }
@@ -308,7 +338,7 @@ function create(params) {
308
338
  * 是否显示固定在右边的权限按钮列表
309
339
  */
310
340
  const showTableFixed = computed(function () {
311
- return $n.indexOf(tableVisibleColumns.value, 'settings') > -1
341
+ return $n_indexOf(tableVisibleColumns.value, 'settings') > -1
312
342
  })
313
343
 
314
344
  // ==========【监听数据】=============================================================================================
@@ -321,7 +351,7 @@ function create(params) {
321
351
 
322
352
  // 设置宫格模式缓存(永久缓存)
323
353
  // #if ! IS_DEV
324
- $n.storage.set('table:grid:' + cacheName, val, 0)
354
+ $n_storage.set('table:grid:' + cacheName, val, 0)
325
355
  // #endif
326
356
  })
327
357
  }
@@ -334,7 +364,7 @@ function create(params) {
334
364
 
335
365
  // 设置可见列缓存(永久缓存)
336
366
  // #if ! IS_DEV
337
- $n.storage.set('table:visible_columns:' + cacheName, val, 0)
367
+ $n_storage.set('table:visible_columns:' + cacheName, val, 0)
338
368
  // #endif
339
369
  })
340
370
  }
@@ -345,10 +375,10 @@ function create(params) {
345
375
  if (hasPowerBtns) {
346
376
  watch(tableFixedPowerBtns, function (lists) {
347
377
 
348
- const index = $n.indexOf(tableVisibleColumns.value, 'settings')
378
+ const index = $n_indexOf(tableVisibleColumns.value, 'settings')
349
379
 
350
380
  // 如果有固定在右边的权限按钮列表
351
- if ($n.isValidArray(lists)) {
381
+ if ($n_isValidArray(lists)) {
352
382
 
353
383
  // 如果设置不在可见列中
354
384
  if (index === -1) {
@@ -387,9 +417,9 @@ function create(params) {
387
417
  */
388
418
  function setQuery(query) {
389
419
 
390
- if ($n.isValidObject(query)) {
420
+ if ($n_isValidObject(query)) {
391
421
 
392
- query = $n.cloneDeep(query)
422
+ query = $n_cloneDeep(query)
393
423
 
394
424
  // 搜索参数键值数组
395
425
  const searchQueryKey = []
@@ -400,11 +430,11 @@ function create(params) {
400
430
  const NSearchValues = []
401
431
 
402
432
  // 参数中是否有自定义搜索参数
403
- const hasNSearch = $n.has(query, 'n_search')
433
+ const hasNSearch = $n_has(query, 'n_search')
404
434
  if (hasNSearch) {
405
435
  // 删除在搜索中存在的参数键值
406
- $n.forIn(query.n_search, function (item, key) {
407
- if ($n.has(query, key)) {
436
+ $n_forIn(query.n_search, function (item, key) {
437
+ if ($n_has(query, key)) {
408
438
  delete query[key]
409
439
  }
410
440
  })
@@ -413,14 +443,14 @@ function create(params) {
413
443
  // 如果允许从参数中获取搜索值
414
444
  if (o.searchFromQuery) {
415
445
 
416
- $n.forEach(rawSearchOptions, function (item, index) {
446
+ $n_forEach(rawSearchOptions, function (item, index) {
417
447
 
418
448
  const valueItem = tableSearchValue.value[index]
419
449
 
420
450
  // 如果传参在搜素 n_search 参数中
421
- if (hasNSearch && $n.has(query.n_search, item.name)) {
451
+ if (hasNSearch && $n_has(query.n_search, item.name)) {
422
452
  const newSearchItem = query.n_search[item.name]
423
- if ($n.isValidArray(newSearchItem)) {
453
+ if ($n_isValidArray(newSearchItem)) {
424
454
  valueItem[0].compare = newSearchItem[0].compare
425
455
  valueItem[0].value = newSearchItem[0].value
426
456
 
@@ -433,23 +463,23 @@ function create(params) {
433
463
  NSearchKeys.push(item.name)
434
464
 
435
465
  // 如果传参在搜索参数中
436
- } else if ($n.has(query, item.name)) {
466
+ } else if ($n_has(query, item.name)) {
437
467
  // 设置单个搜索值
438
- setItemValue(valueItem, $n.isRequired(query[item.name]) ? query[item.name] : '')
468
+ setItemValue(valueItem, $n_isRequired(query[item.name]) ? query[item.name] : '')
439
469
  // 设置参数中搜索的 key
440
470
  searchQueryKey.push(item.name)
441
471
  }
442
472
  })
443
473
 
444
- $n.forEach(searchQueryKey, function (key) {
474
+ $n_forEach(searchQueryKey, function (key) {
445
475
  delete query[key]
446
476
  })
447
477
 
448
478
  if (hasNSearch) {
449
- $n.forIn(query.n_search, function(item, key) {
479
+ $n_forIn(query.n_search, function(item, key) {
450
480
  if (
451
481
  NSearchKeys.indexOf(key) === -1
452
- && $n.isValidArray(item)
482
+ && $n_isValidArray(item)
453
483
  ) {
454
484
  item[0].field = key
455
485
  NSearchValues.push(item[0])
@@ -463,8 +493,8 @@ function create(params) {
463
493
  }
464
494
 
465
495
  } else {
466
- $n.forIn(query.n_search, function(item, key) {
467
- if ($n.isValidArray(item)) {
496
+ $n_forIn(query.n_search, function(item, key) {
497
+ if ($n_isValidArray(item)) {
468
498
  item[0].field = key
469
499
  NSearchValues.push(item[0])
470
500
  if (item.length > 1) {
@@ -575,7 +605,7 @@ function create(params) {
575
605
 
576
606
  const newValue = []
577
607
 
578
- $n.forEach(rawSearchOptions, function (item, index) {
608
+ $n_forEach(rawSearchOptions, function (item, index) {
579
609
  // 如果该搜索条件是隐藏的
580
610
  if (item.hide) {
581
611
  newValue.push(tableSearchValue.value[index])
@@ -586,7 +616,7 @@ function create(params) {
586
616
  })
587
617
 
588
618
  // 还原表格搜索数据
589
- tableSearchValue.value = $n.cloneDeep(newValue)
619
+ tableSearchValue.value = $n_cloneDeep(newValue)
590
620
 
591
621
  // 表格重新加载
592
622
  if (reload) {
@@ -623,7 +653,7 @@ function create(params) {
623
653
  }
624
654
 
625
655
  // 如果排序字段是有效值
626
- if ($n.isValidValue(sortBy)) {
656
+ if ($n_isValidValue(sortBy)) {
627
657
  Object.assign(data, {
628
658
  // 排序字段
629
659
  order_by: sortBy,
@@ -633,20 +663,20 @@ function create(params) {
633
663
  }
634
664
 
635
665
  // 合并参数
636
- $n.forIn(Object.assign({}, rawQuery, tableRequestQuery, o.data), function(value, key) {
666
+ $n_forIn(Object.assign({}, rawQuery, tableRequestQuery, o.data), function(value, key) {
637
667
  // 如果有值
638
- if ($n.isRequired(value)) {
668
+ if ($n_isRequired(value)) {
639
669
  data[key] = value
640
670
  }
641
671
  })
642
672
 
643
673
  // 获取搜索值
644
- const search = $n.search.formatValue(rawSearchOptions, tableSearchValue.value)
645
- if ($n.isValidArray(search)) {
646
- data.n_search = $n.has(data, 'n_search') ? $n.concat(data.n_search, search) : search
674
+ const search = $n_search.formatValue(rawSearchOptions, tableSearchValue.value)
675
+ if ($n_isValidArray(search)) {
676
+ data.n_search = $n_has(data, 'n_search') ? $n_concat(data.n_search, search) : search
647
677
  }
648
678
 
649
- if ($n.isNil(isSummary)) {
679
+ if ($n_isNil(isSummary)) {
650
680
  isSummary = isRequestSummary
651
681
  }
652
682
 
@@ -687,8 +717,8 @@ function create(params) {
687
717
  let result
688
718
 
689
719
  // 如果有自定义请求方法
690
- if ($n.isFunction(o.request)) {
691
- result = await $n.runAsync(o.request)({
720
+ if ($n_isFunction(o.request)) {
721
+ result = await $n_runAsync(o.request)({
692
722
  data,
693
723
  props,
694
724
  rows: tableRows,
@@ -707,7 +737,7 @@ function create(params) {
707
737
  // debounce: false,
708
738
  }, o.httpSettings)
709
739
 
710
- result = await $n.http(opts)
740
+ result = await $n_http(opts)
711
741
  }
712
742
 
713
743
  const { status, data: res } = result
@@ -724,8 +754,8 @@ function create(params) {
724
754
 
725
755
  // 如果请求表格合计
726
756
  if (isRequestSummary) {
727
- const summary = $n.get(res, 'summary')
728
- tableSummary.value = $n.isValidObject(summary) ? summary : null
757
+ const summary = $n_get(res, 'summary')
758
+ tableSummary.value = $n_isValidObject(summary) ? summary : null
729
759
  }
730
760
 
731
761
  // 更新页码
@@ -740,8 +770,8 @@ function create(params) {
740
770
  tablePagination.value.descending = descending
741
771
 
742
772
  // 格式化单条数据
743
- if ($n.isFunction(o.formatRow)) {
744
- $n.forEach(rows, function(row) {
773
+ if ($n_isFunction(o.formatRow)) {
774
+ $n_forEach(rows, function(row) {
745
775
  o.formatRow({
746
776
  row,
747
777
  rows: tableRows,
@@ -776,7 +806,7 @@ function create(params) {
776
806
  opt[o.rowKey] = row[o.rowKey]
777
807
 
778
808
  // 获取当前数据索引
779
- const itemIndex = $n.findIndex(tableSelected.value, opt)
809
+ const itemIndex = $n_findIndex(tableSelected.value, opt)
780
810
 
781
811
  // 如果不存在, 则添加
782
812
  if (itemIndex === -1) {
@@ -801,7 +831,7 @@ function create(params) {
801
831
  _tableRowClick(...e)
802
832
 
803
833
  // 如果有自定义单击事件
804
- if ($n.isFunction(o.rowClick)) {
834
+ if ($n_isFunction(o.rowClick)) {
805
835
  o.rowClick(...e)
806
836
  }
807
837
  }
@@ -832,7 +862,7 @@ function create(params) {
832
862
  _tableRowDblclick(...e)
833
863
 
834
864
  // 如果有自定义双击表格行事件
835
- if ($n.isFunction(o.tableRowDblclick)) {
865
+ if ($n_isFunction(o.tableRowDblclick)) {
836
866
  o.tableRowDblclick(...e)
837
867
  }
838
868
  }
@@ -841,14 +871,14 @@ function create(params) {
841
871
  * 设置表格搜索参数
842
872
  */
843
873
  async function setTableSearchOptions(format) {
844
- tableSearchOptions.value = await $n.search.getOptions(rawSearchOptions, format)
874
+ tableSearchOptions.value = await $n_search.getOptions(rawSearchOptions, format)
845
875
  }
846
876
 
847
877
  /**
848
878
  * 是否有表格搜索值
849
879
  */
850
880
  function hasTableSearchValue() {
851
- return !! $n.search.formatValue(rawSearchOptions, tableSearchValue.value).length
881
+ return !! $n_search.formatValue(rawSearchOptions, tableSearchValue.value).length
852
882
  }
853
883
 
854
884
  // 如果开启搜索
@@ -951,15 +981,17 @@ function create(params) {
951
981
  * 获取表格配置
952
982
  */
953
983
  function config(routePath, path, defaultValue) {
954
- return $n.cloneDeep($n.get(tablesConfig, $n.slash(routePath, 'start', false) + (path ? '.' + path : ''), defaultValue))
984
+ return $n_cloneDeep($n_get(tablesConfig, $n_slash(routePath, 'start', false) + (path ? '.' + path : ''), defaultValue))
955
985
  }
956
986
 
957
987
  /**
958
988
  * 业务表格
959
989
  */
960
- $n.table = {
990
+ const table = {
961
991
  // 创建表格
962
992
  create,
963
993
  // 获取表格配置
964
994
  config,
965
995
  }
996
+
997
+ export default table
@@ -3,10 +3,10 @@ import { stateTimeDiff } from '../store'
3
3
  /**
4
4
  * 获取当前时间戳
5
5
  */
6
- $n.timestamp = function(isMicro = false) {
6
+ export default function timestamp(isMicro = false) {
7
7
 
8
8
  // 获取当前时间戳(毫秒)
9
- const nowTime = new Date().getTime()
9
+ const nowTime = Date.now()
10
10
 
11
11
  // 如果是毫秒
12
12
  if (isMicro) {
package/utils/toast.js CHANGED
@@ -3,7 +3,7 @@ import { Notify, Platform } from 'quasar'
3
3
  /**
4
4
  * 轻提示
5
5
  */
6
- $n.toast = function(params) {
6
+ export default function toast(params) {
7
7
  return Notify.create(Object.assign({
8
8
  // 出现位置
9
9
  position: Platform.is.desktop ? 'top' : 'bottom',