@netang/quasar 0.0.52 → 0.0.54

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 (109) hide show
  1. package/_docs/docs/.vuepress/config.js +40 -0
  2. package/_docs/docs/.vuepress/configs/index.js +2 -0
  3. package/_docs/docs/.vuepress/configs/navbar/index.js +1 -0
  4. package/_docs/docs/.vuepress/configs/navbar/zh.js +16 -0
  5. package/_docs/docs/.vuepress/configs/sidebar/index.js +1 -0
  6. package/_docs/docs/.vuepress/configs/sidebar/zh.js +20 -0
  7. package/_docs/docs/.vuepress/public/css/index.css +3 -0
  8. package/_docs/docs/.vuepress/styles/index.scss +3 -0
  9. package/_docs/docs/components/field-table.md +55 -0
  10. package/_docs/docs/components/field-tree.md +1 -0
  11. package/_docs/docs/index.md +1 -0
  12. package/_docs/docs/utils/alert.md +1 -0
  13. package/_docs/docs/utils/confirm.md +1 -0
  14. package/_docs/package.json +11 -0
  15. package/components/column-title/index.vue +2 -2
  16. package/components/data/index.vue +20 -23
  17. package/components/dialog/index.vue +26 -12
  18. package/components/dialog-table/index.vue +4 -2
  19. package/components/dragger/index.vue +3 -2
  20. package/components/drawer/index.vue +16 -9
  21. package/components/editor-code/index.vue +12 -5
  22. package/components/empty/index.vue +16 -1
  23. package/components/field-date/index.vue +48 -36
  24. package/components/field-table/index.vue +69 -43
  25. package/components/field-text/index.vue +6 -2
  26. package/components/field-tree/index.vue +40 -22
  27. package/components/input-number/index.vue +5 -4
  28. package/components/list-menu/index.vue +14 -2
  29. package/components/power-page/index.vue +10 -0
  30. package/components/private/components/index.js +7 -2
  31. package/components/private/components/move-to-tree/index.vue +7 -3
  32. package/components/private/edit-power-data/index.vue +92 -52
  33. package/components/private/table-visible-columns-button/index.vue +6 -2
  34. package/components/render/index.vue +21 -7
  35. package/components/search/index.vue +30 -2
  36. package/components/search-item/index.vue +24 -8
  37. package/components/select/index.vue +5 -2
  38. package/components/splitter/index.vue +13 -9
  39. package/components/table/index.vue +32 -5
  40. package/components/table-pagination/index.vue +0 -1
  41. package/components/table-splitter/index.vue +22 -3
  42. package/components/table-summary/index.vue +10 -3
  43. package/components/thumbnail/index.vue +16 -6
  44. package/components/toolbar/index.vue +0 -2
  45. package/components/uploader/index.vue +5 -2
  46. package/components/uploader-query/index.vue +48 -27
  47. package/components/value-format/index.vue +19 -12
  48. package/configs/area3.js +1 -0
  49. package/docs/404.html +33 -0
  50. package/docs/assets/404.html-60b35caa.js +1 -0
  51. package/docs/assets/404.html-d1e63d77.js +1 -0
  52. package/docs/assets/alert.html-568d4e94.js +1 -0
  53. package/docs/assets/alert.html-f5dbc3e9.js +1 -0
  54. package/docs/assets/app-8c3ae4de.js +6 -0
  55. package/docs/assets/back-to-top-8efcbe56.svg +1 -0
  56. package/docs/assets/confirm.html-7a1566f6.js +1 -0
  57. package/docs/assets/confirm.html-96f1b004.js +1 -0
  58. package/docs/assets/field-table.html-68d610b0.js +1 -0
  59. package/docs/assets/field-table.html-86cc3511.js +1 -0
  60. package/docs/assets/field-tree.html-45410c3c.js +1 -0
  61. package/docs/assets/field-tree.html-c98ac993.js +1 -0
  62. package/docs/assets/framework-204010b2.js +5 -0
  63. package/docs/assets/index.html-1695dd7c.js +1 -0
  64. package/docs/assets/index.html-65a4aa67.js +1 -0
  65. package/docs/assets/style-ac5a9aa6.css +1 -0
  66. package/docs/components/field-table.html +33 -0
  67. package/docs/components/field-tree.html +33 -0
  68. package/docs/index.html +33 -0
  69. package/docs/utils/alert.html +33 -0
  70. package/docs/utils/confirm.html +33 -0
  71. package/package.json +11 -2
  72. package/store/index.js +3 -20
  73. package/utils/alert.js +3 -1
  74. package/utils/{$area.js → area.js} +27 -14
  75. package/utils/arr.js +6 -2
  76. package/utils/auth.js +140 -0
  77. package/utils/bus.js +1 -1
  78. package/utils/config.js +42 -15
  79. package/utils/{confrim.js → confirm.js} +1 -1
  80. package/utils/copy.js +18 -0
  81. package/utils/{$dialog.js → dialog.js} +7 -3
  82. package/utils/dict.js +5 -28
  83. package/utils/dictOptions.js +24 -0
  84. package/utils/{$form.js → form.js} +6 -2
  85. package/utils/getData.js +21 -9
  86. package/utils/getFile.js +11 -5
  87. package/utils/getImage.js +23 -12
  88. package/utils/getTime.js +9 -4
  89. package/utils/index.js +61 -0
  90. package/utils/loading.js +3 -1
  91. package/utils/notify.js +1 -1
  92. package/utils/{$power.js → power.js} +164 -118
  93. package/utils/previewImage.js +4 -2
  94. package/utils/price.js +12 -3
  95. package/utils/rule.js +13 -0
  96. package/utils/ruleValid.js +10 -0
  97. package/utils/{$search.js → search.js} +82 -51
  98. package/utils/{$table.js → table.js} +119 -87
  99. package/utils/timestamp.js +2 -2
  100. package/utils/toast.js +1 -1
  101. package/utils/{$tree.js → tree.js} +69 -46
  102. package/utils/uploader/qiniu.js +31 -15
  103. package/utils/{$uploader.js → uploader.js} +87 -56
  104. package/utils/useAuth.js +12 -5
  105. package/utils/useRouter.js +4 -4
  106. package/utils/useUploader.js +0 -5
  107. package/utils/$auth.js +0 -135
  108. package/utils/$rule.js +0 -17
  109. package/utils/http.js +0 -251
@@ -106,7 +106,7 @@
106
106
  <div
107
107
  class="cursor-pointer full-width"
108
108
  :class="{
109
- 'text-primary': $n.indexOf(treeTicked, node.id) > -1,
109
+ 'text-primary': checkTreeNodeActive(node),
110
110
  }"
111
111
  @click="onNode($event, node)"
112
112
  >{{node.label}}</div>
@@ -118,7 +118,17 @@
118
118
  </template>
119
119
 
120
120
  <script>
121
- import { ref, computed, watch, onMounted, onUpdated } from 'vue'
121
+ import { ref, computed, watch, onUpdated } from 'vue'
122
+
123
+ import $n_has from 'lodash/has'
124
+ import $n_uniq from 'lodash/uniq'
125
+ import $n_concat from 'lodash/concat'
126
+
127
+ import $n_forEach from '@netang/utils/forEach'
128
+ import $n_isValidArray from '@netang/utils/isValidArray'
129
+ import $n_indexOf from '@netang/utils/indexOf'
130
+ import $n_isRequired from '@netang/utils/isRequired'
131
+ import $n_isValidValue from '@netang/utils/isValidValue'
122
132
 
123
133
  export default {
124
134
 
@@ -193,7 +203,7 @@ export default {
193
203
  const showValue = computed(function () {
194
204
 
195
205
  // 如果有已选数据
196
- return $n.isValidArray(treeTickedNodes.value)
206
+ return $n_isValidArray(treeTickedNodes.value)
197
207
  // 取已选数据第一条的标签
198
208
  ? treeTickedNodes.value[0].label
199
209
  : ''
@@ -243,10 +253,10 @@ export default {
243
253
 
244
254
  const lists = []
245
255
 
246
- $n.forEach(treeTicked.value, function (treeKey) {
256
+ $n_forEach(treeTicked.value, function (treeKey) {
247
257
 
248
258
  // 获取树选择的节点
249
- if ($n.has(treeAll, treeKey)) {
259
+ if ($n_has(treeAll, treeKey)) {
250
260
  lists.push({
251
261
  id: treeKey,
252
262
  label: treeAll[treeKey][props.showAllLevels ? 'path' : 'label'],
@@ -290,7 +300,7 @@ export default {
290
300
  // 如果弹出层是隐藏的
291
301
  ! showPopup.value
292
302
  // 如果输入框有值
293
- && $n.isValidValue(val)
303
+ && $n_isValidValue(val)
294
304
  ) {
295
305
  // 显示弹出层
296
306
  popupRef.value.show()
@@ -323,13 +333,13 @@ export default {
323
333
  }
324
334
 
325
335
  // 如果是父节点
326
- if ($n.isValidArray(item.children)) {
336
+ if ($n_isValidArray(item.children)) {
327
337
  getChildren(item.children, item.id, path)
328
338
  }
329
339
  }
330
340
  }
331
341
 
332
- if ($n.isValidArray(props.nodes)) {
342
+ if ($n_isValidArray(props.nodes)) {
333
343
  getChildren(props.nodes, 0, '')
334
344
  }
335
345
 
@@ -347,21 +357,21 @@ export default {
347
357
  // 如果是单选
348
358
  ! props.multiple
349
359
  // 如果有值
350
- && $n.isRequired(props.modelValue)
360
+ && $n_isRequired(props.modelValue)
351
361
  // 存在节点
352
- && $n.has(treeAll, props.modelValue)
362
+ && $n_has(treeAll, props.modelValue)
353
363
  ) {
354
364
  // 获取父节点
355
365
  function getParent({ id, pid, children }) {
356
366
 
357
367
  // 如果是父级节点
358
- if ($n.isValidArray(children)) {
368
+ if ($n_isValidArray(children)) {
359
369
  // 设为展开
360
370
  expanded.push(id)
361
371
  }
362
372
 
363
373
  // 如果有父节点, 则继续向上寻找
364
- if (pid && $n.has(treeAll, pid)) {
374
+ if (pid && $n_has(treeAll, pid)) {
365
375
  getParent(treeAll[pid])
366
376
  }
367
377
  }
@@ -370,7 +380,7 @@ export default {
370
380
  }
371
381
 
372
382
  if (props.expanded) {
373
- expanded = $n.uniq($n.concat(expanded, props.expanded))
383
+ expanded = $n_uniq($n_concat(expanded, props.expanded))
374
384
  }
375
385
 
376
386
  return expanded
@@ -383,11 +393,11 @@ export default {
383
393
 
384
394
  // 如果是多选
385
395
  if (props.multiple) {
386
- return $n.isValidArray(val) ? val : []
396
+ return $n_isValidArray(val) ? val : []
387
397
  }
388
398
 
389
399
  // 如果为有效值
390
- if ($n.isRequired(val)) {
400
+ if ($n_isRequired(val)) {
391
401
  return [ val ]
392
402
  }
393
403
 
@@ -406,13 +416,13 @@ export default {
406
416
  /**
407
417
  * 点击节点
408
418
  */
409
- function onNode(e, { id, label, children }) {
419
+ function onNode(e, { id, children }) {
410
420
 
411
421
  // 如果是多选
412
422
  if (props.multiple) {
413
423
 
414
424
  // 如果是父节点
415
- if ($n.isValidArray(children)) {
425
+ if ($n_isValidArray(children)) {
416
426
 
417
427
  // 则无任何操作
418
428
  return
@@ -422,7 +432,7 @@ export default {
422
432
  const _ticked = [...treeTicked.value]
423
433
 
424
434
  // 获取值在树数据中的索引
425
- const index = $n.indexOf(_ticked, id)
435
+ const index = $n_indexOf(_ticked, id)
426
436
 
427
437
  // 如果在数据中
428
438
  if (index > -1) {
@@ -443,7 +453,7 @@ export default {
443
453
 
444
454
  if (
445
455
  // 如果是父节点
446
- $n.isValidArray(children)
456
+ $n_isValidArray(children)
447
457
  // 如果仅可选择叶子节点
448
458
  && ! props.strict
449
459
  ) {
@@ -570,13 +580,20 @@ export default {
570
580
  }
571
581
  }
572
582
 
583
+ /**
584
+ * 树节点是否激活
585
+ */
586
+ function checkTreeNodeActive({ id }) {
587
+ return $n_indexOf(treeTicked.value, id) > -1
588
+ }
589
+
573
590
  // ==========【生命周期】=========================================================================================
574
591
 
575
592
  /**
576
593
  * 在组件因为响应式状态变更而更新其 DOM 树之后调用
577
594
  */
578
595
  onUpdated(function () {
579
- if ($n.has(popupRef.value, 'currentComponent.ref.updatePosition')) {
596
+ if ($n_has(popupRef.value, 'currentComponent.ref.updatePosition')) {
580
597
  popupRef.value.currentComponent.ref.updatePosition()
581
598
  }
582
599
  })
@@ -621,14 +638,15 @@ export default {
621
638
 
622
639
  // 弹出层显示回调
623
640
  onPopupShow,
641
+
642
+ // 节点是否激活
643
+ checkTreeNodeActive,
624
644
  }
625
645
  },
626
646
  }
627
647
  </script>
628
648
 
629
649
  <style lang="scss">
630
- @import "@/assets/sass/var.scss";
631
-
632
650
  .n-field-tree {
633
651
  .q-field__input--padding {
634
652
  padding-left: 4px;
@@ -72,6 +72,9 @@
72
72
 
73
73
  <script>
74
74
  import { computed, ref, watch } from 'vue'
75
+ import $n_filter from 'lodash/filter'
76
+
77
+ import $n_isValidObject from '@netang/utils/isValidObject'
75
78
 
76
79
  export default {
77
80
 
@@ -151,7 +154,7 @@ export default {
151
154
  */
152
155
  const slotNames = computed(function() {
153
156
 
154
- if ($n.isValidObject(slots)) {
157
+ if ($n_isValidObject(slots)) {
155
158
 
156
159
  // 忽略插槽
157
160
  const ignoreKeys = []
@@ -167,7 +170,7 @@ export default {
167
170
  const keys = Object.keys(slots)
168
171
 
169
172
  if (ignoreKeys.length) {
170
- return $n.filter(keys, e => ignoreKeys.indexOf(e) === -1)
173
+ return $n_filter(keys, e => ignoreKeys.indexOf(e) === -1)
171
174
  }
172
175
 
173
176
  return keys
@@ -514,8 +517,6 @@ export default {
514
517
  </script>
515
518
 
516
519
  <style lang="scss">
517
- @import "@/assets/sass/var.scss";
518
-
519
520
  .n-input-number {
520
521
 
521
522
  // 居中显示
@@ -12,6 +12,11 @@
12
12
  <script>
13
13
  import { watch } from 'vue'
14
14
 
15
+ import $n_has from 'lodash/has'
16
+ import $n_isValidArray from '@netang/utils/isValidArray'
17
+
18
+ import NListMenuItem from '../list-menu-item'
19
+
15
20
  export default {
16
21
 
17
22
  /**
@@ -19,6 +24,13 @@ export default {
19
24
  */
20
25
  name: 'NListMenu',
21
26
 
27
+ /**
28
+ * 组件
29
+ */
30
+ components: {
31
+ NListMenuItem,
32
+ },
33
+
22
34
  /**
23
35
  * 声明属性
24
36
  */
@@ -71,7 +83,7 @@ export default {
71
83
  // 如果不是根节点
72
84
  attr.pid
73
85
  // 有父节点
74
- && $n.has(parentAll, attr.pid)
86
+ && $n_has(parentAll, attr.pid)
75
87
  ) {
76
88
  const parentItem = parentAll[attr.pid]
77
89
 
@@ -117,7 +129,7 @@ export default {
117
129
  watch([()=>props.data, ()=>props.activeValue], function() {
118
130
 
119
131
  // 设置激活状态
120
- if ($n.isValidArray(props.data)) {
132
+ if ($n_isValidArray(props.data)) {
121
133
  setActive()
122
134
  }
123
135
 
@@ -20,8 +20,11 @@
20
20
 
21
21
  <script>
22
22
  import { inject } from 'vue'
23
+
23
24
  import { NPowerKey } from '../../utils/symbols'
24
25
 
26
+ import NEmpty from '../empty'
27
+
25
28
  export default {
26
29
 
27
30
  /**
@@ -29,6 +32,13 @@ export default {
29
32
  */
30
33
  name: 'NPowerPage',
31
34
 
35
+ /**
36
+ * 组件
37
+ */
38
+ components: {
39
+ NEmpty,
40
+ },
41
+
32
42
  /**
33
43
  * 组合式
34
44
  */
@@ -1,6 +1,11 @@
1
- import dialog from '@/components/private/dialog'
1
+ import { configs } from '../../../utils/config'
2
+
3
+ const {
4
+ // 对话框组件
5
+ dialogComponents,
6
+ } = configs
2
7
 
3
8
  export default {
4
9
  moveToTree: () => import('./move-to-tree'),
5
- ...dialog,
10
+ ...dialogComponents,
6
11
  }
@@ -26,7 +26,11 @@
26
26
  </template>
27
27
 
28
28
  <script>
29
- import { ref, isRef, toRaw, watch } from 'vue'
29
+ import { ref, isRef, watch, inject } from 'vue'
30
+
31
+ import $n_isValidArray from '@netang/utils/isValidArray'
32
+
33
+ import { NDialogKey } from '../../../../utils/symbols'
30
34
 
31
35
  export default {
32
36
 
@@ -48,7 +52,7 @@ export default {
48
52
  submit,
49
53
  // 父级声明属性
50
54
  props,
51
- } = $n.$dialog.inject()
55
+ } = inject(NDialogKey)
52
56
 
53
57
  const {
54
58
  // 树节点列表
@@ -121,7 +125,7 @@ export default {
121
125
  return ref(val.value)
122
126
  }
123
127
 
124
- if ($n.isValidArray(val)) {
128
+ if ($n_isValidArray(val)) {
125
129
  return ref(val)
126
130
  }
127
131
  }