@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/getFile.js CHANGED
@@ -1,27 +1,33 @@
1
+ import $n_isValidArray from '@netang/utils/isValidArray'
2
+ import $n_isValidString from '@netang/utils/isValidString'
3
+ import $n_slash from '@netang/utils/slash'
4
+
5
+ import { configs } from './config'
6
+
1
7
  /**
2
8
  * 获取文件
3
9
  */
4
- $n.getFile = function(src) {
10
+ export default function getFile(src) {
5
11
 
6
12
  if (src) {
7
13
 
8
14
  // 如果为数组, 则获取第一个
9
- if ($n.isValidArray(src)) {
15
+ if ($n_isValidArray(src)) {
10
16
  src = src[0]
11
17
  }
12
18
 
13
- if ($n.isValidString(src)) {
19
+ if ($n_isValidString(src)) {
14
20
 
15
21
  // http(s):// 或 data: 或 blob: 开头的地址
16
22
  if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
17
23
  return src
18
24
  }
19
25
 
20
- const uploaderConfig = $n.config('uploader.upload')
26
+ const uploaderConfig = configs.uploader.upload
21
27
  switch (uploaderConfig.type) {
22
28
  // 七牛云
23
29
  case 'qiniu':
24
- return $n.slash(uploaderConfig.domain, 'end', true) + src
30
+ return $n_slash(uploaderConfig.domain, 'end', true) + src
25
31
  }
26
32
  }
27
33
  }
package/utils/getImage.js CHANGED
@@ -1,27 +1,38 @@
1
+ import $n_has from 'lodash/has'
2
+ import $n_isString from 'lodash/isString'
3
+
4
+ import $n_isValidArray from '@netang/utils/isValidArray'
5
+ import $n_isValidObject from '@netang/utils/isValidObject'
6
+ import $n_isValidString from '@netang/utils/isValidString'
7
+ import $n_isNumeric from '@netang/utils/isNumeric'
8
+ import $n_slash from '@netang/utils/slash'
9
+
10
+ import $n_config from './config'
11
+
1
12
  /**
2
13
  * 获取图片
3
14
  */
4
- $n.getImage = function(src, params) {
15
+ export default function getImage(src, params) {
5
16
 
6
17
  if (src) {
7
18
 
8
19
  // 如果为数组, 则获取第一个
9
- if ($n.isValidArray(src)) {
20
+ if ($n_isValidArray(src)) {
10
21
  src = src[0]
11
22
 
12
23
  // 如果为对象
13
- } else if ($n.isValidObject(src)) {
24
+ } else if ($n_isValidObject(src)) {
14
25
 
15
- if ($n.has(src, 'params')) {
26
+ if ($n_has(src, 'params')) {
16
27
  params = src.params
17
28
  }
18
29
 
19
- if ($n.has(src, 'img')) {
30
+ if ($n_has(src, 'img')) {
20
31
  src = src.img
21
32
  }
22
33
  }
23
34
 
24
- if ($n.isValidString(src)) {
35
+ if ($n_isValidString(src)) {
25
36
 
26
37
  // http(s):// 或 data: 或 blob: 开头的地址
27
38
  if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
@@ -29,12 +40,12 @@ $n.getImage = function(src, params) {
29
40
  }
30
41
 
31
42
  // 如果为对象定义的规格
32
- if ($n.isValidObject(params)) {
43
+ if ($n_isValidObject(params)) {
33
44
 
34
45
  // 【自动缩放】
35
46
  // 如果没有定义 w
36
47
  // --------------------------------------------------
37
- if (! $n.has(params, 'w')) {
48
+ if (! $n_has(params, 'w')) {
38
49
 
39
50
  const {
40
51
  width,
@@ -46,11 +57,11 @@ $n.getImage = function(src, params) {
46
57
 
47
58
  let w = width
48
59
 
49
- if (! $n.isNumeric(w) && $n.isString(w)) {
60
+ if (! $n_isNumeric(w) && $n_isString(w)) {
50
61
  w = w.replace('px', '')
51
62
  }
52
63
 
53
- if ($n.isNumeric(w)) {
64
+ if ($n_isNumeric(w)) {
54
65
  w = Number(w)
55
66
  if (w > 0) {
56
67
 
@@ -75,7 +86,7 @@ $n.getImage = function(src, params) {
75
86
  // --------------------------------------------------
76
87
  }
77
88
 
78
- const uploaderConfig = $n.config('uploader.upload')
89
+ const uploaderConfig = $n_config('uploader.upload')
79
90
  switch (uploaderConfig.type) {
80
91
  // 七牛云
81
92
  case 'qiniu':
@@ -127,7 +138,7 @@ $n.getImage = function(src, params) {
127
138
  src += '/format/' + format
128
139
  }
129
140
 
130
- return $n.slash(uploaderConfig.domain, 'end', true) + src
141
+ return $n_slash(uploaderConfig.domain, 'end', true) + src
131
142
  }
132
143
  }
133
144
  }
package/utils/getTime.js CHANGED
@@ -1,12 +1,17 @@
1
+ import $n_isValidString from '@netang/utils/isValidString'
2
+ import $n_toDate from '@netang/utils/toDate'
3
+
4
+ import $n_timestamp from './timestamp'
5
+
1
6
  import { date as quasarDate } from 'quasar'
2
7
 
3
8
  /**
4
9
  * 获取时间
5
10
  */
6
- $n.getTime = function(time, params, defaultValue = '') {
11
+ export default function getTime(time, params, defaultValue = '') {
7
12
 
8
13
  if (! time) {
9
- return $n.isValidString(params) ? params : defaultValue
14
+ return $n_isValidString(params) ? params : defaultValue
10
15
  }
11
16
 
12
17
  let {
@@ -33,10 +38,10 @@ $n.getTime = function(time, params, defaultValue = '') {
33
38
  }, params)
34
39
 
35
40
  // 传入时间
36
- const date = $n.toDate(time)
41
+ const date = $n_toDate(time)
37
42
 
38
43
  // 当前时间
39
- const now = $n.toDate($n.timestamp())
44
+ const now = $n_toDate($n_timestamp())
40
45
 
41
46
  // 如果是自然化时间
42
47
  // 如果是今天, 则显示时分秒
package/utils/index.js ADDED
@@ -0,0 +1,61 @@
1
+ import alert from './alert'
2
+ import area from './area'
3
+ import arr from './arr'
4
+ import auth from './auth'
5
+ import bus from './bus'
6
+ import config from './config'
7
+ import confirm from './confirm'
8
+ import copy from './copy'
9
+ import dialog from './dialog'
10
+ import dict from './dict'
11
+ import dictOptions from './dictOptions'
12
+ import form from './form'
13
+ import getData from './getData'
14
+ import getFile from './getFile'
15
+ import getImage from './getImage'
16
+ import getTime from './getTime'
17
+ import loading from './loading'
18
+ import notify from './notify'
19
+ import power from './power'
20
+ import previewImage from './previewImage'
21
+ import price from './price'
22
+ import rule from './rule'
23
+ import ruleValid from './ruleValid'
24
+ import search from './search'
25
+ import table from './table'
26
+ import timestamp from './timestamp'
27
+ import toast from './toast'
28
+ import tree from './tree'
29
+ import uploader from './uploader'
30
+
31
+ export default {
32
+ alert,
33
+ area,
34
+ arr,
35
+ auth,
36
+ bus,
37
+ config,
38
+ confirm,
39
+ copy,
40
+ dialog,
41
+ dict,
42
+ dictOptions,
43
+ form,
44
+ getData,
45
+ getFile,
46
+ getImage,
47
+ getTime,
48
+ loading,
49
+ notify,
50
+ power,
51
+ previewImage,
52
+ price,
53
+ rule,
54
+ ruleValid,
55
+ search,
56
+ table,
57
+ timestamp,
58
+ toast,
59
+ tree,
60
+ uploader,
61
+ }
package/utils/loading.js CHANGED
@@ -3,7 +3,7 @@ import { Loading } from 'quasar'
3
3
  /**
4
4
  * 加载
5
5
  */
6
- $n.loading = {
6
+ const loading = {
7
7
  show() {
8
8
  Loading.show()
9
9
  },
@@ -11,3 +11,5 @@ $n.loading = {
11
11
  Loading.hide()
12
12
  },
13
13
  }
14
+
15
+ export default loading
package/utils/notify.js CHANGED
@@ -3,7 +3,7 @@ import { Notify } from 'quasar'
3
3
  /**
4
4
  * 通知
5
5
  */
6
- $n.notify = function(params) {
6
+ export default function notify(params) {
7
7
  Notify.create(Object.assign({
8
8
  // 出现位置
9
9
  position: 'bottom-right',