@netang/quasar 0.0.47 → 0.0.49

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 (57) hide show
  1. package/components/dialog/index.vue +10 -10
  2. package/components/dialog-table/index.vue +1 -1
  3. package/components/dragger/index.vue +2 -2
  4. package/components/drawer/index.vue +7 -7
  5. package/components/field-date/index.vue +35 -35
  6. package/components/field-table/index.vue +39 -41
  7. package/components/field-text/index.vue +2 -2
  8. package/components/field-tree/index.vue +19 -19
  9. package/components/input-number/index.vue +2 -2
  10. package/components/list-menu/index.vue +2 -2
  11. package/components/private/components/move-to-tree/index.vue +2 -2
  12. package/components/private/edit-power-data/index.vue +50 -50
  13. package/components/private/table-visible-columns-button/index.vue +2 -2
  14. package/components/render/index.vue +6 -6
  15. package/components/search/index.vue +2 -2
  16. package/components/search-item/index.vue +5 -5
  17. package/components/select/index.vue +2 -2
  18. package/components/splitter/index.vue +7 -7
  19. package/components/table/index.vue +5 -5
  20. package/components/table-splitter/index.vue +22 -11
  21. package/components/table-summary/index.vue +3 -3
  22. package/components/thumbnail/index.vue +6 -6
  23. package/components/uploader/index.vue +1 -1
  24. package/components/uploader-query/index.vue +25 -25
  25. package/components/value-format/index.vue +65 -38
  26. package/package.json +1 -1
  27. package/utils/$area.js +13 -13
  28. package/utils/$auth.js +6 -6
  29. package/utils/$dialog.js +3 -3
  30. package/utils/$form.js +2 -2
  31. package/utils/$power.js +124 -117
  32. package/utils/$rule.js +4 -4
  33. package/utils/$search.js +50 -50
  34. package/utils/$table.js +76 -76
  35. package/utils/$tree.js +43 -43
  36. package/utils/$uploader.js +47 -47
  37. package/utils/alert.js +1 -1
  38. package/utils/arr.js +2 -2
  39. package/utils/bus.js +1 -1
  40. package/utils/config.js +4 -4
  41. package/utils/confrim.js +1 -1
  42. package/utils/dict.js +5 -5
  43. package/utils/getData.js +9 -9
  44. package/utils/getFile.js +5 -5
  45. package/utils/getImage.js +12 -12
  46. package/utils/getTime.js +4 -4
  47. package/utils/http.js +20 -20
  48. package/utils/loading.js +1 -1
  49. package/utils/notify.js +1 -1
  50. package/utils/previewImage.js +2 -2
  51. package/utils/price.js +3 -3
  52. package/utils/timestamp.js +1 -1
  53. package/utils/toast.js +1 -1
  54. package/utils/uploader/qiniu.js +11 -11
  55. package/utils/useAuth.js +2 -2
  56. package/utils/useRouter.js +4 -4
  57. package/components/input-format/index.vue +0 -268
@@ -3,7 +3,7 @@
3
3
  class="n-field-tree"
4
4
  :model-value="showValue"
5
5
  :readonly="readonly"
6
- :clearable="clearable && (! multiple || collapseTags)"
6
+ :clearable="clearable"
7
7
  @focus="onFieldFocus"
8
8
  @blur="onFieldBlur"
9
9
  @clear="onFieldClear"
@@ -106,7 +106,7 @@
106
106
  <div
107
107
  class="cursor-pointer full-width"
108
108
  :class="{
109
- 'text-primary': utils.indexOf(treeTicked, node.id) > -1,
109
+ 'text-primary': $n.indexOf(treeTicked, node.id) > -1,
110
110
  }"
111
111
  @click="onNode($event, node)"
112
112
  >{{node.label}}</div>
@@ -193,7 +193,7 @@ export default {
193
193
  const showValue = computed(function () {
194
194
 
195
195
  // 如果有已选数据
196
- return utils.isValidArray(treeTickedNodes.value)
196
+ return $n.isValidArray(treeTickedNodes.value)
197
197
  // 取已选数据第一条的标签
198
198
  ? treeTickedNodes.value[0].label
199
199
  : ''
@@ -243,10 +243,10 @@ export default {
243
243
 
244
244
  const lists = []
245
245
 
246
- utils.forEach(treeTicked.value, function (treeKey) {
246
+ $n.forEach(treeTicked.value, function (treeKey) {
247
247
 
248
248
  // 获取树选择的节点
249
- if (_.has(treeAll, treeKey)) {
249
+ if ($n.has(treeAll, treeKey)) {
250
250
  lists.push({
251
251
  id: treeKey,
252
252
  label: treeAll[treeKey][props.showAllLevels ? 'path' : 'label'],
@@ -290,7 +290,7 @@ export default {
290
290
  // 如果弹出层是隐藏的
291
291
  ! showPopup.value
292
292
  // 如果输入框有值
293
- && utils.isValidValue(val)
293
+ && $n.isValidValue(val)
294
294
  ) {
295
295
  // 显示弹出层
296
296
  popupRef.value.show()
@@ -323,13 +323,13 @@ export default {
323
323
  }
324
324
 
325
325
  // 如果是父节点
326
- if (utils.isValidArray(item.children)) {
326
+ if ($n.isValidArray(item.children)) {
327
327
  getChildren(item.children, item.id, path)
328
328
  }
329
329
  }
330
330
  }
331
331
 
332
- if (utils.isValidArray(props.nodes)) {
332
+ if ($n.isValidArray(props.nodes)) {
333
333
  getChildren(props.nodes, 0, '')
334
334
  }
335
335
 
@@ -347,21 +347,21 @@ export default {
347
347
  // 如果是单选
348
348
  ! props.multiple
349
349
  // 如果有值
350
- && utils.isRequired(props.modelValue)
350
+ && $n.isRequired(props.modelValue)
351
351
  // 存在节点
352
- && _.has(treeAll, props.modelValue)
352
+ && $n.has(treeAll, props.modelValue)
353
353
  ) {
354
354
  // 获取父节点
355
355
  function getParent({ id, pid, children }) {
356
356
 
357
357
  // 如果是父级节点
358
- if (utils.isValidArray(children)) {
358
+ if ($n.isValidArray(children)) {
359
359
  // 设为展开
360
360
  expanded.push(id)
361
361
  }
362
362
 
363
363
  // 如果有父节点, 则继续向上寻找
364
- if (pid && _.has(treeAll, pid)) {
364
+ if (pid && $n.has(treeAll, pid)) {
365
365
  getParent(treeAll[pid])
366
366
  }
367
367
  }
@@ -370,7 +370,7 @@ export default {
370
370
  }
371
371
 
372
372
  if (props.expanded) {
373
- expanded = _.uniq(_.concat(expanded, props.expanded))
373
+ expanded = $n.uniq($n.concat(expanded, props.expanded))
374
374
  }
375
375
 
376
376
  return expanded
@@ -383,11 +383,11 @@ export default {
383
383
 
384
384
  // 如果是多选
385
385
  if (props.multiple) {
386
- return utils.isValidArray(val) ? val : []
386
+ return $n.isValidArray(val) ? val : []
387
387
  }
388
388
 
389
389
  // 如果为有效值
390
- if (utils.isRequired(val)) {
390
+ if ($n.isRequired(val)) {
391
391
  return [ val ]
392
392
  }
393
393
 
@@ -412,7 +412,7 @@ export default {
412
412
  if (props.multiple) {
413
413
 
414
414
  // 如果是父节点
415
- if (utils.isValidArray(children)) {
415
+ if ($n.isValidArray(children)) {
416
416
 
417
417
  // 则无任何操作
418
418
  return
@@ -422,7 +422,7 @@ export default {
422
422
  const _ticked = [...treeTicked.value]
423
423
 
424
424
  // 获取值在树数据中的索引
425
- const index = utils.indexOf(_ticked, id)
425
+ const index = $n.indexOf(_ticked, id)
426
426
 
427
427
  // 如果在数据中
428
428
  if (index > -1) {
@@ -443,7 +443,7 @@ export default {
443
443
 
444
444
  if (
445
445
  // 如果是父节点
446
- utils.isValidArray(children)
446
+ $n.isValidArray(children)
447
447
  // 如果仅可选择叶子节点
448
448
  && ! props.strict
449
449
  ) {
@@ -576,7 +576,7 @@ export default {
576
576
  * 在组件因为响应式状态变更而更新其 DOM 树之后调用
577
577
  */
578
578
  onUpdated(function () {
579
- if (_.has(popupRef.value, 'currentComponent.ref.updatePosition')) {
579
+ if ($n.has(popupRef.value, 'currentComponent.ref.updatePosition')) {
580
580
  popupRef.value.currentComponent.ref.updatePosition()
581
581
  }
582
582
  })
@@ -151,7 +151,7 @@ export default {
151
151
  */
152
152
  const slotNames = computed(function() {
153
153
 
154
- if (utils.isValidObject(slots)) {
154
+ if ($n.isValidObject(slots)) {
155
155
 
156
156
  // 忽略插槽
157
157
  const ignoreKeys = []
@@ -167,7 +167,7 @@ export default {
167
167
  const keys = Object.keys(slots)
168
168
 
169
169
  if (ignoreKeys.length) {
170
- return _.filter(keys, e => ignoreKeys.indexOf(e) === -1)
170
+ return $n.filter(keys, e => ignoreKeys.indexOf(e) === -1)
171
171
  }
172
172
 
173
173
  return keys
@@ -71,7 +71,7 @@ export default {
71
71
  // 如果不是根节点
72
72
  attr.pid
73
73
  // 有父节点
74
- && _.has(parentAll, attr.pid)
74
+ && $n.has(parentAll, attr.pid)
75
75
  ) {
76
76
  const parentItem = parentAll[attr.pid]
77
77
 
@@ -117,7 +117,7 @@ export default {
117
117
  watch([()=>props.data, ()=>props.activeValue], function() {
118
118
 
119
119
  // 设置激活状态
120
- if (utils.isValidArray(props.data)) {
120
+ if ($n.isValidArray(props.data)) {
121
121
  setActive()
122
122
  }
123
123
 
@@ -48,7 +48,7 @@ export default {
48
48
  submit,
49
49
  // 父级声明属性
50
50
  props,
51
- } = utils.$dialog.inject()
51
+ } = $n.$dialog.inject()
52
52
 
53
53
  const {
54
54
  // 树节点列表
@@ -121,7 +121,7 @@ export default {
121
121
  return ref(val.value)
122
122
  }
123
123
 
124
- if (utils.isValidArray(val)) {
124
+ if ($n.isValidArray(val)) {
125
125
  return ref(val)
126
126
  }
127
127
  }
@@ -184,7 +184,7 @@
184
184
  </div>
185
185
 
186
186
  <!-- 请求成功参数 -->
187
- <!--<div class="col-xs-12 col-sm-6 col-md-3" v-if="utils.indexOf(['closePush', 'closePushRefresh'], formData.requestSuccess.type) > -1">-->
187
+ <!--<div class="col-xs-12 col-sm-6 col-md-3" v-if="$n.indexOf(['closePush', 'closePushRefresh'], formData.requestSuccess.type) > -1">-->
188
188
 
189
189
  <!-- &lt;!&ndash; 树 &ndash;&gt;-->
190
190
  <!-- <n-field-tree-->
@@ -230,10 +230,10 @@
230
230
 
231
231
  <q-item-section side>
232
232
  <div class="text-grey-8 q-gutter-xs">
233
- <q-btn icon="add" size="12px" flat dense round @click="utils.arr.add(formData.requestQuery.table, itemIndex, '')" />
234
- <q-btn icon="remove" size="12px" flat dense round @click="utils.arr.delete(formData.requestQuery.table, itemIndex)" :disable="itemIndex === 0" />
235
- <q-btn icon="expand_less" size="12px" flat dense round @click="utils.arr.up(formData.requestQuery.table, itemIndex)" :disable="itemIndex === 0" />
236
- <q-btn icon="expand_more" size="12px" flat dense round @click="utils.arr.down(formData.requestQuery.table, itemIndex)" :disable="formData.requestQuery.table.length <= itemIndex + 1" />
233
+ <q-btn icon="add" size="12px" flat dense round @click="$n.arr.add(formData.requestQuery.table, itemIndex, '')" />
234
+ <q-btn icon="remove" size="12px" flat dense round @click="$n.arr.delete(formData.requestQuery.table, itemIndex)" :disable="itemIndex === 0" />
235
+ <q-btn icon="expand_less" size="12px" flat dense round @click="$n.arr.up(formData.requestQuery.table, itemIndex)" :disable="itemIndex === 0" />
236
+ <q-btn icon="expand_more" size="12px" flat dense round @click="$n.arr.down(formData.requestQuery.table, itemIndex)" :disable="formData.requestQuery.table.length <= itemIndex + 1" />
237
237
  </div>
238
238
  </q-item-section>
239
239
  </q-item>
@@ -264,10 +264,10 @@
264
264
 
265
265
  <q-item-section side>
266
266
  <div class="text-grey-8 q-gutter-xs">
267
- <q-btn icon="add" size="12px" flat dense round @click="utils.arr.add(formData.requestQuery.query, itemIndex, '')" />
268
- <q-btn icon="remove" size="12px" flat dense round @click="utils.arr.delete(formData.requestQuery.query, itemIndex)" :disable="itemIndex === 0" />
269
- <q-btn icon="expand_less" size="12px" flat dense round @click="utils.arr.up(formData.requestQuery.query, itemIndex)" :disable="itemIndex === 0" />
270
- <q-btn icon="expand_more" size="12px" flat dense round @click="utils.arr.down(formData.requestQuery.query, itemIndex)" :disable="formData.requestQuery.query.length <= itemIndex + 1" />
267
+ <q-btn icon="add" size="12px" flat dense round @click="$n.arr.add(formData.requestQuery.query, itemIndex, '')" />
268
+ <q-btn icon="remove" size="12px" flat dense round @click="$n.arr.delete(formData.requestQuery.query, itemIndex)" :disable="itemIndex === 0" />
269
+ <q-btn icon="expand_less" size="12px" flat dense round @click="$n.arr.up(formData.requestQuery.query, itemIndex)" :disable="itemIndex === 0" />
270
+ <q-btn icon="expand_more" size="12px" flat dense round @click="$n.arr.down(formData.requestQuery.query, itemIndex)" :disable="formData.requestQuery.query.length <= itemIndex + 1" />
271
271
  </div>
272
272
  </q-item-section>
273
273
  </q-item>
@@ -367,9 +367,9 @@ export default {
367
367
 
368
368
  let obj = {}
369
369
 
370
- if (utils.isJson(props.modelValue)) {
371
- const data = utils.json.parse(props.modelValue)
372
- if (utils.isValidObject(data)) {
370
+ if ($n.isJson(props.modelValue)) {
371
+ const data = $n.json.parse(props.modelValue)
372
+ if ($n.isValidObject(data)) {
373
373
  obj = data
374
374
  }
375
375
  }
@@ -415,7 +415,7 @@ export default {
415
415
  const rawKeys = Object.keys(rawObj)
416
416
 
417
417
  // 删除数据中的无效键值
418
- utils.forIn(obj, function (item, key) {
418
+ $n.forIn(obj, function (item, key) {
419
419
  // 如果键值不在原始键值中
420
420
  if (rawKeys.indexOf(key) === -1) {
421
421
  // 则删除
@@ -424,12 +424,12 @@ export default {
424
424
  })
425
425
 
426
426
  // 判断 requestSuccess 值是否合法
427
- if (_.has(obj, 'requestSuccess') && ! utils.isValidObject(obj.requestSuccess)) {
427
+ if ($n.has(obj, 'requestSuccess') && ! $n.isValidObject(obj.requestSuccess)) {
428
428
  delete(obj.requestSuccess)
429
429
  }
430
430
 
431
431
  // 判断 requestQuery 值是否合法
432
- if (_.has(obj, 'requestQuery') && ! utils.isValidObject(obj.requestQuery)) {
432
+ if ($n.has(obj, 'requestQuery') && ! $n.isValidObject(obj.requestQuery)) {
433
433
  delete(obj.requestQuery)
434
434
  }
435
435
 
@@ -446,12 +446,12 @@ export default {
446
446
  obj.confirmContent = ''
447
447
  if (obj.confirmPassword) {
448
448
  confirm = 2
449
- if (utils.isValidString(obj.confirmPassword)) {
449
+ if ($n.isValidString(obj.confirmPassword)) {
450
450
  obj.confirmContent = obj.confirmPassword
451
451
  }
452
452
  } else if (obj.confirm) {
453
453
  confirm = 1
454
- if (utils.isValidString(obj.confirm)) {
454
+ if ($n.isValidString(obj.confirm)) {
455
455
  obj.confirmContent = obj.confirm
456
456
  }
457
457
  }
@@ -460,36 +460,36 @@ export default {
460
460
 
461
461
  // 【格式化请求参数中的 table】
462
462
  // ------------------------------------------------------------
463
- if (utils.isValidString(obj.requestQuery.table)) {
463
+ if ($n.isValidString(obj.requestQuery.table)) {
464
464
  obj.requestQuery.table = [obj.requestQuery.table]
465
- } else if (! utils.isValidArray(obj.requestQuery.table)) {
465
+ } else if (! $n.isValidArray(obj.requestQuery.table)) {
466
466
  obj.requestQuery.table = ['']
467
467
  }
468
468
 
469
469
  // 【格式化请求参数中的 query】
470
470
  // ------------------------------------------------------------
471
- if (_.has(obj.requestQuery, 'query')) {
471
+ if ($n.has(obj.requestQuery, 'query')) {
472
472
 
473
473
  // 如果是有效值
474
- if (utils.isValidValue(obj.requestQuery.query)) {
474
+ if ($n.isValidValue(obj.requestQuery.query)) {
475
475
  obj.requestQuery.query = [obj.requestQuery.query]
476
476
 
477
477
  // 如果是有效对象
478
- } else if (utils.isValidObject(obj.requestQuery.query)) {
479
- obj.requestQuery.query = [utils.json.stringify(obj.requestQuery.query)]
478
+ } else if ($n.isValidObject(obj.requestQuery.query)) {
479
+ obj.requestQuery.query = [$n.json.stringify(obj.requestQuery.query)]
480
480
 
481
481
  // 如果是有效数组
482
- } else if (utils.isValidArray(obj.requestQuery.query)) {
482
+ } else if ($n.isValidArray(obj.requestQuery.query)) {
483
483
  const query = []
484
- utils.forEach(obj.requestQuery.query, function(item, key) {
484
+ $n.forEach(obj.requestQuery.query, function(item, key) {
485
485
 
486
486
  // 如果是有效值
487
- if (utils.isValidValue(item)) {
487
+ if ($n.isValidValue(item)) {
488
488
  query.push(item)
489
489
 
490
490
  // 如果是对象
491
- } else if (utils.isValidObject(item)) {
492
- query.push(utils.json.stringify(item))
491
+ } else if ($n.isValidObject(item)) {
492
+ query.push($n.json.stringify(item))
493
493
  }
494
494
  })
495
495
  obj.requestQuery.query = query.length ? query : ['']
@@ -506,15 +506,15 @@ export default {
506
506
 
507
507
  // 【格式化其他参数】
508
508
  // ------------------------------------------------------------
509
- if (! _.has(obj, 'params')) {
509
+ if (! $n.has(obj, 'params')) {
510
510
  obj.params = ''
511
511
 
512
512
  // 如果不是字符串
513
- } else if (! utils.isValidString(obj.params)) {
514
- if (utils.isValidObject(obj.params)) {
515
- obj.params = utils.json.stringify(obj.params)
516
- } else if (utils.isValidArray(obj.params)) {
517
- obj.params = utils.json.stringify(obj.params)
513
+ } else if (! $n.isValidString(obj.params)) {
514
+ if ($n.isValidObject(obj.params)) {
515
+ obj.params = $n.json.stringify(obj.params)
516
+ } else if ($n.isValidArray(obj.params)) {
517
+ obj.params = $n.json.stringify(obj.params)
518
518
  } else {
519
519
  obj.params = ''
520
520
  }
@@ -543,20 +543,20 @@ export default {
543
543
  // 请求表格参数
544
544
  const lists = []
545
545
 
546
- utils.forEach(data.requestQuery[field], function(value) {
546
+ $n.forEach(data.requestQuery[field], function(value) {
547
547
 
548
548
  value = formatParams(value)
549
549
 
550
550
  // 如果有值
551
- if (utils.isRequired(value)) {
551
+ if ($n.isRequired(value)) {
552
552
 
553
553
  // 如果为表格
554
554
  if (field === 'table') {
555
555
 
556
- if (Array.isArray(value) || _.isPlainObject(value)) {
556
+ if (Array.isArray(value) || $n.isPlainObject(value)) {
557
557
 
558
558
  // 轻提示
559
- utils.toast({
559
+ $n.toast({
560
560
  message: '请求列表参数格式不能是数组或对象',
561
561
  })
562
562
  return false
@@ -565,7 +565,7 @@ export default {
565
565
  // 否则为参数
566
566
  } else if (Array.isArray(value)) {
567
567
  // 轻提示
568
- utils.toast({
568
+ $n.toast({
569
569
  message: '请求传参参数格式不能是数组',
570
570
  })
571
571
  return false
@@ -577,7 +577,7 @@ export default {
577
577
  })
578
578
 
579
579
  if (lists.length) {
580
- if (! _.has(obj, 'requestQuery')) {
580
+ if (! $n.has(obj, 'requestQuery')) {
581
581
  obj.requestQuery = {}
582
582
  }
583
583
  obj.requestQuery[field] = lists.length === 1 ? lists[0] : lists
@@ -588,14 +588,14 @@ export default {
588
588
 
589
589
  // 格式化其他参数
590
590
  function formatParams(value) {
591
- value = utils.trimString(value)
591
+ value = $n.trimString(value)
592
592
  if (
593
593
  (value.startsWith('[') || value.startsWith('{'))
594
- && utils.isJson(value)
594
+ && $n.isJson(value)
595
595
  ) {
596
- value = utils.json.parse(value)
596
+ value = $n.json.parse(value)
597
597
 
598
- if (! Array.isArray(value) && ! _.isPlainObject(value)) {
598
+ if (! Array.isArray(value) && ! $n.isPlainObject(value)) {
599
599
  return ''
600
600
  }
601
601
  }
@@ -641,7 +641,7 @@ export default {
641
641
  // 如果没有选择跳转页面
642
642
  if (! data.toPage) {
643
643
  // 轻提示
644
- utils.toast({
644
+ $n.toast({
645
645
  message: '请选择跳转页面',
646
646
  })
647
647
  return false
@@ -664,11 +664,11 @@ export default {
664
664
 
665
665
  // 如果是(1:提交前确认)
666
666
  if (data.confirm === 1) {
667
- obj.confirm = utils.isValidString(data.confirmContent) ? data.confirmContent : true
667
+ obj.confirm = $n.isValidString(data.confirmContent) ? data.confirmContent : true
668
668
 
669
669
  // 否则是(2:提交前确认登录密码)
670
670
  } else {
671
- obj.confirmPassword = utils.isValidString(data.confirmContent) ? data.confirmContent : true
671
+ obj.confirmPassword = $n.isValidString(data.confirmContent) ? data.confirmContent : true
672
672
  }
673
673
  }
674
674
 
@@ -677,7 +677,7 @@ export default {
677
677
  obj.requestSuccess = {
678
678
  type: data.requestSuccess.type
679
679
  }
680
- // if (utils.indexOf(['closePush', 'closePushRefresh'], data.requestSuccess.type) > -1) {
680
+ // if ($n.indexOf(['closePush', 'closePushRefresh'], data.requestSuccess.type) > -1) {
681
681
  // if (data.requestSuccess.params) {
682
682
  // obj.requestSuccess.params = data.requestSuccess.params
683
683
  // } else {
@@ -689,13 +689,13 @@ export default {
689
689
 
690
690
  // 自定义参数
691
691
  const params = formatParams(data.params)
692
- if (utils.isRequired(params)) {
692
+ if ($n.isRequired(params)) {
693
693
  obj.params = params
694
694
  }
695
695
  }
696
696
 
697
697
  // 转为 json
698
- return utils.isValidObject(obj) ? utils.json.stringify(obj) : ''
698
+ return $n.isValidObject(obj) ? $n.json.stringify(obj) : ''
699
699
  }
700
700
 
701
701
  // ==========【返回】=============================================================================================
@@ -42,7 +42,7 @@
42
42
  <q-icon
43
43
  size="xs"
44
44
  name="check"
45
- v-show="utils.indexOf(tableVisibleColumns, item.name) > -1"
45
+ v-show="$n.indexOf(tableVisibleColumns, item.name) > -1"
46
46
  />
47
47
  </q-item-section>
48
48
  </q-item>
@@ -79,7 +79,7 @@ export default {
79
79
  * 表格可见列点击
80
80
  */
81
81
  function onTableVisible(item) {
82
- const index = utils.indexOf(tableVisibleColumns.value, item.name)
82
+ const index = $n.indexOf(tableVisibleColumns.value, item.name)
83
83
  if (index > -1) {
84
84
  tableVisibleColumns.value.splice(index, 1)
85
85
  } else {
@@ -67,10 +67,10 @@ export default {
67
67
  // 如果是路由路径
68
68
  if (props.path) {
69
69
  // 获取路由组件
70
- comp = _.get(routers, `${utils.slash(props.path, 'start', false)}.component`)
70
+ comp = $n.get(routers, `${$n.slash(props.path, 'start', false)}.component`)
71
71
 
72
72
  // 如果有组件标识
73
- } else if (props.name && _.has(components, props.name)) {
73
+ } else if (props.name && $n.has(components, props.name)) {
74
74
  // 获取自定义组件
75
75
  comp = components[props.name]
76
76
  }
@@ -81,7 +81,7 @@ export default {
81
81
  }
82
82
 
83
83
  // 如果是方法, 则说明是异步组件
84
- if (_.isFunction(comp)) {
84
+ if ($n.isFunction(comp)) {
85
85
  return defineAsyncComponent(comp)
86
86
  }
87
87
 
@@ -96,16 +96,16 @@ export default {
96
96
  // 组件标识
97
97
  name: props.name,
98
98
  // 参数
99
- query: utils.isValidObject(props.query) ? props.query : {},
99
+ query: $n.isValidObject(props.query) ? props.query : {},
100
100
  // 组件传参
101
101
  props: props.props,
102
102
  }
103
103
 
104
104
  // 如果有路由路径
105
- if (utils.isValidString(props.path)) {
105
+ if ($n.isValidString(props.path)) {
106
106
 
107
107
  // 获取页面路由
108
- const $route = utils.router.resolve({
108
+ const $route = $n.router.resolve({
109
109
  path: props.path,
110
110
  query: data.query,
111
111
  })
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex column absolute-full" v-if="utils.isValidArray(options)">
2
+ <div class="flex column absolute-full" v-if="$n.isValidArray(options)">
3
3
  <q-scroll-area class="n-flex-1">
4
4
 
5
5
  <div class="n-search q-pa-sm q-pt-sm q-gutter-sm">
@@ -189,7 +189,7 @@ export default {
189
189
  setup() {
190
190
  return {
191
191
  // 如果金额为分
192
- centToYuan: utils.config('priceCent') === true,
192
+ centToYuan: $n.config('priceCent') === true,
193
193
  }
194
194
  }
195
195
  }
@@ -31,7 +31,7 @@
31
31
  <slot
32
32
  :label="data.label"
33
33
  :index="0"
34
- :multiple="utils.indexOf([dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN], modelValue[0].compare) > -1"
34
+ :multiple="$n.indexOf([dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN], modelValue[0].compare) > -1"
35
35
  v-else
36
36
  />
37
37
  </div>
@@ -39,7 +39,7 @@
39
39
  <!-- 比较2(类型为 > / >=) -->
40
40
  <div
41
41
  class="n-field-group row"
42
- v-if="data.compareOptions2.length && utils.indexOf([dicts.SEARCH_TYPE__GT, dicts.SEARCH_TYPE__GTE], modelValue[0].compare) > -1"
42
+ v-if="data.compareOptions2.length && $n.indexOf([dicts.SEARCH_TYPE__GT, dicts.SEARCH_TYPE__GTE], modelValue[0].compare) > -1"
43
43
  >
44
44
  <!-- 比较类型2 -->
45
45
  <q-select
@@ -102,11 +102,11 @@ export default {
102
102
  */
103
103
  watch(()=>props.modelValue[0].compare, function(val) {
104
104
  // 如果类型不为 in / not in, 为单选
105
- if (utils.indexOf([dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN], val) === -1) {
106
- const arr = utils.split(props.modelValue[0].value, ',')
105
+ if ($n.indexOf([dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN], val) === -1) {
106
+ const arr = $n.split(props.modelValue[0].value, ',')
107
107
  if (arr.length !== 1) {
108
108
  // 克隆值
109
- const _modelValue = _.cloneDeep(props.modelValue)
109
+ const _modelValue = $n.cloneDeep(props.modelValue)
110
110
 
111
111
  // 更新值
112
112
  _modelValue[0].value = arr.length > 1 ? arr[0] : ''
@@ -84,7 +84,7 @@ export default {
84
84
  * 插槽标识
85
85
  */
86
86
  const slotNames = computed(function() {
87
- return utils.isValidObject(slots) ? Object.keys(slots) : []
87
+ return $n.isValidObject(slots) ? Object.keys(slots) : []
88
88
  })
89
89
 
90
90
  // ==========【当前值】===========================================================================================
@@ -130,7 +130,7 @@ export default {
130
130
  // 选项还原为初始值
131
131
  rawOptions
132
132
  // 否则筛选选项
133
- : utils.collection(rawOptions)
133
+ : $n.collection(rawOptions)
134
134
  .where(props.optionLabel, 'like', value)
135
135
  .toArray()
136
136
  })
@@ -104,10 +104,10 @@ export default {
104
104
  if (props.cache) {
105
105
 
106
106
  // 设置缓存名
107
- cacheName = `splitter:${props.cache === true ? ($power && $power.routePath ? $power.routePath : utils.router.getRoute('path')) : props.cache}:`
107
+ cacheName = `splitter:${props.cache === true ? ($power && $power.routePath ? $power.routePath : $n.router.getRoute('path')) : props.cache}:`
108
108
 
109
109
  // 从缓存获取初始值
110
- let cache = utils.storage.get(cacheName + 'modelValue')
110
+ let cache = $n.storage.get(cacheName + 'modelValue')
111
111
  if (cache !== null) {
112
112
  rawValue = cache
113
113
  }
@@ -119,7 +119,7 @@ export default {
119
119
 
120
120
  } else {
121
121
  // 从缓存获取初始值
122
- cache = utils.storage.get(cacheName + 'before')
122
+ cache = $n.storage.get(cacheName + 'before')
123
123
  if (cache !== null) {
124
124
  rawBefore = cache
125
125
  }
@@ -132,7 +132,7 @@ export default {
132
132
 
133
133
  } else {
134
134
  // 从缓存获取初始值
135
- cache = utils.storage.get(cacheName + 'after')
135
+ cache = $n.storage.get(cacheName + 'after')
136
136
  if (cache !== null) {
137
137
  rawAfter = cache
138
138
  }
@@ -155,7 +155,7 @@ export default {
155
155
  }
156
156
 
157
157
  // 创建防抖睡眠方法
158
- const sleep = utils.debounceSleep()
158
+ const sleep = $n.debounceSleep()
159
159
 
160
160
  // 当前值
161
161
  const currentValue = ref(rawValue)
@@ -184,7 +184,7 @@ export default {
184
184
 
185
185
  const keys = []
186
186
 
187
- if (utils.isValidObject(slots)) {
187
+ if ($n.isValidObject(slots)) {
188
188
 
189
189
  for (const key in slots) {
190
190
  if (key === 'before') {
@@ -243,7 +243,7 @@ export default {
243
243
  await sleep(500, key)
244
244
 
245
245
  // 设置缓存(永久缓存)
246
- utils.storage.set(cacheName + key, val, 0)
246
+ $n.storage.set(cacheName + key, val, 0)
247
247
  }
248
248
  }
249
249