@netang/quasar 0.0.102 → 0.0.103

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 (162) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +11 -11
  3. package/_docs/docs/.vuepress/client.js +8 -8
  4. package/_docs/docs/.vuepress/config.js +40 -40
  5. package/_docs/docs/.vuepress/configs/index.js +2 -2
  6. package/_docs/docs/.vuepress/configs/navbar/index.js +1 -1
  7. package/_docs/docs/.vuepress/configs/navbar/zh.js +16 -16
  8. package/_docs/docs/.vuepress/configs/sidebar/index.js +1 -1
  9. package/_docs/docs/.vuepress/configs/sidebar/zh.js +75 -75
  10. package/_docs/docs/.vuepress/public/css/index.css +3 -3
  11. package/_docs/docs/.vuepress/styles/index.scss +3 -3
  12. package/_docs/docs/components/column-title.md +25 -25
  13. package/_docs/docs/components/data.md +66 -66
  14. package/_docs/docs/components/dialog.md +59 -59
  15. package/_docs/docs/components/dragger.md +26 -26
  16. package/_docs/docs/components/editor-code.md +16 -16
  17. package/_docs/docs/components/empty.md +13 -13
  18. package/_docs/docs/components/field-date.md +16 -16
  19. package/_docs/docs/components/field-text.md +57 -57
  20. package/_docs/docs/components/field-tree.md +14 -14
  21. package/_docs/docs/components/img.md +25 -25
  22. package/_docs/docs/components/input-number.md +21 -21
  23. package/_docs/docs/components/list-menu-item.md +21 -21
  24. package/_docs/docs/components/list-menu.md +21 -21
  25. package/_docs/docs/components/power-page.md +21 -21
  26. package/_docs/docs/components/price.md +21 -21
  27. package/_docs/docs/components/render.md +12 -12
  28. package/_docs/docs/components/search-item.md +10 -10
  29. package/_docs/docs/components/search.md +12 -12
  30. package/_docs/docs/components/select.md +11 -11
  31. package/_docs/docs/components/splitter.md +15 -15
  32. package/_docs/docs/components/table-column-fixed.md +20 -20
  33. package/_docs/docs/components/table-pagination.md +20 -20
  34. package/_docs/docs/components/table-splitter.md +20 -20
  35. package/_docs/docs/components/table-summary.md +20 -20
  36. package/_docs/docs/components/table.md +25 -25
  37. package/_docs/docs/components/thumbnail.md +18 -18
  38. package/_docs/docs/components/toolbar.md +9 -9
  39. package/_docs/docs/components/uploader-query.md +19 -19
  40. package/_docs/docs/components/uploader.md +16 -16
  41. package/_docs/docs/components/value-format.md +26 -26
  42. package/_docs/docs/index.md +1 -1
  43. package/_docs/docs/utils/alert.md +26 -26
  44. package/_docs/docs/utils/area.md +112 -112
  45. package/_docs/docs/utils/arr.md +80 -80
  46. package/_docs/docs/utils/auth.md +101 -101
  47. package/_docs/docs/utils/bus.md +18 -18
  48. package/_docs/docs/utils/confirm.md +31 -31
  49. package/_docs/docs/utils/copy.md +22 -22
  50. package/_docs/docs/utils/dialog.md +98 -98
  51. package/_docs/docs/utils/dict.md +50 -50
  52. package/_docs/docs/utils/dictOptions.md +27 -27
  53. package/_docs/docs/utils/form.md +33 -33
  54. package/_docs/docs/utils/getData.md +60 -60
  55. package/_docs/docs/utils/getFile.md +21 -21
  56. package/_docs/docs/utils/getImage.md +33 -33
  57. package/_docs/docs/utils/getTime.md +51 -51
  58. package/_docs/docs/utils/index.md +1 -1
  59. package/_docs/docs/utils/loading.md +18 -18
  60. package/_docs/docs/utils/notify.md +29 -29
  61. package/_docs/docs/utils/power.md +353 -353
  62. package/_docs/docs/utils/previewImage.md +11 -11
  63. package/_docs/docs/utils/price.md +45 -45
  64. package/_docs/docs/utils/rule.md +30 -30
  65. package/_docs/docs/utils/ruleValid.md +31 -31
  66. package/_docs/docs/utils/symbols.md +30 -30
  67. package/_docs/docs/utils/table.md +194 -194
  68. package/_docs/docs/utils/timestamp.md +27 -27
  69. package/_docs/docs/utils/toast.md +27 -27
  70. package/_docs/docs/utils/tree.md +174 -174
  71. package/_docs/docs/utils/uploader.md +29 -29
  72. package/_docs/package.json +11 -11
  73. package/components/column-title/index.vue +37 -37
  74. package/components/data/index.vue +20 -20
  75. package/components/dialog/index.vue +372 -372
  76. package/components/dragger/index.vue +203 -203
  77. package/components/drawer/index.vue +303 -303
  78. package/components/editor-code/index.vue +289 -289
  79. package/components/empty/index.vue +71 -71
  80. package/components/field-date/index.vue +850 -850
  81. package/components/field-date/methods.js +100 -100
  82. package/components/field-table/index.vue +1222 -1222
  83. package/components/field-text/index.vue +165 -165
  84. package/components/field-tree/index.vue +103 -81
  85. package/components/img/index.vue +202 -202
  86. package/components/input-number/index.vue +546 -546
  87. package/components/list-menu/index.vue +149 -149
  88. package/components/list-menu-item/index.vue +79 -79
  89. package/components/power-page/index.vue +92 -92
  90. package/components/price/index.vue +188 -188
  91. package/components/private/components/index.js +11 -11
  92. package/components/private/components/move-to-tree/index.vue +154 -154
  93. package/components/private/edit-power-data/index.vue +816 -816
  94. package/components/private/table-visible-columns-button/index.vue +109 -109
  95. package/components/render/index.vue +150 -150
  96. package/components/search/index.vue +222 -222
  97. package/components/search-item/index.vue +210 -210
  98. package/components/splitter/index.vue +415 -415
  99. package/components/table/index.vue +456 -456
  100. package/components/table-column-fixed/index.vue +112 -112
  101. package/components/table-pagination/index.vue +192 -192
  102. package/components/table-splitter/index.vue +360 -360
  103. package/components/table-summary/index.vue +110 -110
  104. package/components/thumbnail/index.vue +72 -72
  105. package/components/toolbar/container.vue +31 -31
  106. package/components/toolbar/index.vue +136 -136
  107. package/components/uploader/index.vue +158 -158
  108. package/components/uploader-query/index.vue +758 -758
  109. package/components/value-format/index.vue +274 -274
  110. package/configs/area3.js +1 -1
  111. package/docs/css/index.css +3 -3
  112. package/package.json +1 -1
  113. package/sass/common.scss +174 -174
  114. package/sass/index.scss +14 -14
  115. package/sass/line.scss +39 -39
  116. package/sass/quasar/btn.scss +46 -46
  117. package/sass/quasar/common.scss +3 -3
  118. package/sass/quasar/dialog.scss +7 -7
  119. package/sass/quasar/drawer.scss +6 -6
  120. package/sass/quasar/field.scss +243 -243
  121. package/sass/quasar/loading.scss +6 -6
  122. package/sass/quasar/menu.scss +8 -8
  123. package/sass/quasar/table.scss +150 -150
  124. package/sass/quasar/toolbar.scss +22 -22
  125. package/store/index.js +29 -29
  126. package/utils/$auth.js +127 -127
  127. package/utils/$form.js +56 -56
  128. package/utils/$power.js +1215 -1215
  129. package/utils/$rule.js +13 -13
  130. package/utils/$ruleValid.js +10 -10
  131. package/utils/$table.js +999 -999
  132. package/utils/$tree.js +713 -713
  133. package/utils/alert.js +12 -12
  134. package/utils/area.js +400 -400
  135. package/utils/arr.js +51 -51
  136. package/utils/bus.js +6 -6
  137. package/utils/config.js +52 -52
  138. package/utils/confirm.js +11 -11
  139. package/utils/copy.js +30 -30
  140. package/utils/dialog.js +36 -36
  141. package/utils/dict.js +21 -21
  142. package/utils/dictOptions.js +28 -28
  143. package/utils/getData.js +73 -73
  144. package/utils/getFile.js +40 -40
  145. package/utils/getImage.js +153 -153
  146. package/utils/getTime.js +106 -106
  147. package/utils/index.js +61 -61
  148. package/utils/loading.js +15 -15
  149. package/utils/notify.js +13 -13
  150. package/utils/previewImage.js +10 -10
  151. package/utils/price.js +18 -18
  152. package/utils/symbols.js +18 -18
  153. package/utils/timestamp.js +18 -18
  154. package/utils/toast.js +13 -13
  155. package/utils/uploader/aliyun.js +6 -6
  156. package/utils/uploader/local.js +8 -8
  157. package/utils/uploader/qiniu.js +321 -321
  158. package/utils/uploader.js +1059 -1059
  159. package/utils/useAuth.js +30 -30
  160. package/utils/useRouter.js +47 -47
  161. package/utils/useSearch.js +0 -6
  162. package/utils/useUploader.js +53 -53
@@ -1,109 +1,109 @@
1
- <template>
2
- <!-- 表格筛选可见列按钮-->
3
- <q-btn
4
- icon="checklist"
5
- dense
6
- round
7
- flat
8
- v-if="tableColumns.length"
9
- >
10
- <q-menu
11
- self="top middle"
12
- :offset="[0, 8]"
13
- >
14
- <q-list style="min-width: 250px" dense bordered>
15
-
16
- <!-- 表格宫格 -->
17
- <template v-if="tableGrid !== null">
18
- <q-item
19
- clickable
20
- @click="tableGrid = ! tableGrid"
21
- >
22
- <q-item-section>宫格模式</q-item-section>
23
- <q-item-section side>
24
- <q-icon
25
- size="xs"
26
- name="check"
27
- v-show="tableGrid"
28
- />
29
- </q-item-section>
30
- </q-item>
31
- <q-separator />
32
- </template>
33
-
34
- <!-- 筛选表格列 -->
35
- <q-item
36
- v-for="item in tableColumns"
37
- clickable
38
- @click="onTableVisible(item)"
39
- >
40
- <q-item-section>{{item.label}}</q-item-section>
41
- <q-item-section side>
42
- <q-icon
43
- size="xs"
44
- name="check"
45
- v-show="indexOf(tableVisibleColumns, item.name) > -1"
46
- />
47
- </q-item-section>
48
- </q-item>
49
- </q-list>
50
- </q-menu>
51
- </q-btn>
52
- </template>
53
-
54
- <script>
55
- import { inject } from 'vue'
56
-
57
- import $n_indexOf from '@netang/utils/indexOf'
58
-
59
- import { NTableKey } from '../../../utils/symbols'
60
-
61
- export default {
62
-
63
- /**
64
- * 组合式
65
- */
66
- setup() {
67
-
68
- // ==========【方法】=============================================================================================
69
-
70
- // 获取表格注入数据
71
- const {
72
- // 表格列数据(对象数组)
73
- tableColumns,
74
- // 表格可见列
75
- tableVisibleColumns,
76
- // 表格宫格
77
- tableGrid,
78
- } = inject(NTableKey)
79
-
80
- /**
81
- * 表格可见列点击
82
- */
83
- function onTableVisible(item) {
84
- const index = $n_indexOf(tableVisibleColumns.value, item.name)
85
- if (index > -1) {
86
- tableVisibleColumns.value.splice(index, 1)
87
- } else {
88
- tableVisibleColumns.value.push(item.name)
89
- }
90
- }
91
-
92
- // ==========【返回】=============================================================================================
93
-
94
- return {
95
- // 表格列数据(对象数组)
96
- tableColumns,
97
- // 表格可见列
98
- tableVisibleColumns,
99
- // 表格宫格
100
- tableGrid,
101
-
102
- // 表格可见列点击
103
- onTableVisible,
104
-
105
- indexOf: $n_indexOf,
106
- }
107
- },
108
- }
109
- </script>
1
+ <template>
2
+ <!-- 表格筛选可见列按钮-->
3
+ <q-btn
4
+ icon="checklist"
5
+ dense
6
+ round
7
+ flat
8
+ v-if="tableColumns.length"
9
+ >
10
+ <q-menu
11
+ self="top middle"
12
+ :offset="[0, 8]"
13
+ >
14
+ <q-list style="min-width: 250px" dense bordered>
15
+
16
+ <!-- 表格宫格 -->
17
+ <template v-if="tableGrid !== null">
18
+ <q-item
19
+ clickable
20
+ @click="tableGrid = ! tableGrid"
21
+ >
22
+ <q-item-section>宫格模式</q-item-section>
23
+ <q-item-section side>
24
+ <q-icon
25
+ size="xs"
26
+ name="check"
27
+ v-show="tableGrid"
28
+ />
29
+ </q-item-section>
30
+ </q-item>
31
+ <q-separator />
32
+ </template>
33
+
34
+ <!-- 筛选表格列 -->
35
+ <q-item
36
+ v-for="item in tableColumns"
37
+ clickable
38
+ @click="onTableVisible(item)"
39
+ >
40
+ <q-item-section>{{item.label}}</q-item-section>
41
+ <q-item-section side>
42
+ <q-icon
43
+ size="xs"
44
+ name="check"
45
+ v-show="indexOf(tableVisibleColumns, item.name) > -1"
46
+ />
47
+ </q-item-section>
48
+ </q-item>
49
+ </q-list>
50
+ </q-menu>
51
+ </q-btn>
52
+ </template>
53
+
54
+ <script>
55
+ import { inject } from 'vue'
56
+
57
+ import $n_indexOf from '@netang/utils/indexOf'
58
+
59
+ import { NTableKey } from '../../../utils/symbols'
60
+
61
+ export default {
62
+
63
+ /**
64
+ * 组合式
65
+ */
66
+ setup() {
67
+
68
+ // ==========【方法】=============================================================================================
69
+
70
+ // 获取表格注入数据
71
+ const {
72
+ // 表格列数据(对象数组)
73
+ tableColumns,
74
+ // 表格可见列
75
+ tableVisibleColumns,
76
+ // 表格宫格
77
+ tableGrid,
78
+ } = inject(NTableKey)
79
+
80
+ /**
81
+ * 表格可见列点击
82
+ */
83
+ function onTableVisible(item) {
84
+ const index = $n_indexOf(tableVisibleColumns.value, item.name)
85
+ if (index > -1) {
86
+ tableVisibleColumns.value.splice(index, 1)
87
+ } else {
88
+ tableVisibleColumns.value.push(item.name)
89
+ }
90
+ }
91
+
92
+ // ==========【返回】=============================================================================================
93
+
94
+ return {
95
+ // 表格列数据(对象数组)
96
+ tableColumns,
97
+ // 表格可见列
98
+ tableVisibleColumns,
99
+ // 表格宫格
100
+ tableGrid,
101
+
102
+ // 表格可见列点击
103
+ onTableVisible,
104
+
105
+ indexOf: $n_indexOf,
106
+ }
107
+ },
108
+ }
109
+ </script>
@@ -1,150 +1,150 @@
1
- <template>
2
- <q-layout
3
- class="absolute-full"
4
- view="hHh lpr fFf"
5
- container
6
- >
7
- <q-page-container>
8
- <slot
9
- :query="query"
10
- v-bind="props"
11
- v-if="$slots.default"
12
- />
13
- <component
14
- :is="comp"
15
- :query="query"
16
- v-bind="props"
17
- v-else
18
- />
19
- </q-page-container>
20
- </q-layout>
21
- </template>
22
-
23
- <script>
24
- import { computed, defineAsyncComponent, provide } from 'vue'
25
- import $n_router from '@netang/utils/vue/router'
26
-
27
- import $n_has from 'lodash/has'
28
- import $n_get from 'lodash/get'
29
- import $n_isFunction from 'lodash/isFunction'
30
-
31
- import $n_isValidObject from '@netang/utils/isValidObject'
32
- import $n_isValidString from '@netang/utils/isValidString'
33
- import $n_slash from '@netang/utils/slash'
34
-
35
- import components from '../private/components'
36
-
37
- import { NRenderKey } from '../../utils/symbols'
38
- import { configs } from '../../utils/config'
39
-
40
- const {
41
- // 自定义路由
42
- routers,
43
- } = configs
44
-
45
- export default {
46
-
47
- /**
48
- * 标识
49
- */
50
- name: 'NRender',
51
-
52
- /**
53
- * 声明属性
54
- */
55
- props: {
56
- // 组件标识
57
- name: String,
58
- // 组件路径
59
- path: String,
60
- // 参数
61
- query: Object,
62
- // 组件传参
63
- props: Object,
64
- },
65
-
66
- /**
67
- * 组合式
68
- */
69
- setup(props) {
70
-
71
- // ==========【计算属性】=========================================================================================
72
-
73
- /**
74
- * 获取当前组件
75
- */
76
- const comp = computed(function () {
77
-
78
- // 组件
79
- let comp
80
-
81
- // 如果是路由路径
82
- if (props.path) {
83
- // 获取路由组件
84
- comp = $n_get(routers, `${$n_slash(props.path, 'start', false)}.component`)
85
-
86
- // 如果有组件标识
87
- } else if (props.name && $n_has(components, props.name)) {
88
- // 获取自定义组件
89
- comp = components[props.name]
90
- }
91
-
92
- // 如果没有组件
93
- if (! comp) {
94
- return
95
- }
96
-
97
- // 如果是方法, 则说明是异步组件
98
- if ($n_isFunction(comp)) {
99
- return defineAsyncComponent(comp)
100
- }
101
-
102
- // 返回组件
103
- return comp
104
- })
105
-
106
- // ==========【注入】============================================================================================
107
-
108
- // 注入数据
109
- const data = {
110
- // 组件标识
111
- name: props.name,
112
- // 参数
113
- query: $n_isValidObject(props.query) ? props.query : {},
114
- // 组件传参
115
- props: props.props,
116
- }
117
-
118
- // 如果有路由路径
119
- if ($n_isValidString(props.path)) {
120
-
121
- // 获取页面路由
122
- const $route = $n_router.resolve({
123
- path: props.path,
124
- query: data.query,
125
- })
126
-
127
- Object.assign(data, {
128
- // 当前路由全路径
129
- routeFullPath: $route.fullPath,
130
- // 当前路由路径
131
- routePath: $route.path,
132
- // 当前路由参数
133
- routeQuery: $route.query,
134
- // 当前路由,
135
- $route,
136
- })
137
- }
138
-
139
- // 向后代注入数据
140
- provide(NRenderKey, data)
141
-
142
- // ==========【返回】=============================================================================================
143
-
144
- return {
145
- // 组件
146
- comp,
147
- }
148
- }
149
- }
150
- </script>
1
+ <template>
2
+ <q-layout
3
+ class="absolute-full"
4
+ view="hHh lpr fFf"
5
+ container
6
+ >
7
+ <q-page-container>
8
+ <slot
9
+ :query="query"
10
+ v-bind="props"
11
+ v-if="$slots.default"
12
+ />
13
+ <component
14
+ :is="comp"
15
+ :query="query"
16
+ v-bind="props"
17
+ v-else
18
+ />
19
+ </q-page-container>
20
+ </q-layout>
21
+ </template>
22
+
23
+ <script>
24
+ import { computed, defineAsyncComponent, provide } from 'vue'
25
+ import $n_router from '@netang/utils/vue/router'
26
+
27
+ import $n_has from 'lodash/has'
28
+ import $n_get from 'lodash/get'
29
+ import $n_isFunction from 'lodash/isFunction'
30
+
31
+ import $n_isValidObject from '@netang/utils/isValidObject'
32
+ import $n_isValidString from '@netang/utils/isValidString'
33
+ import $n_slash from '@netang/utils/slash'
34
+
35
+ import components from '../private/components'
36
+
37
+ import { NRenderKey } from '../../utils/symbols'
38
+ import { configs } from '../../utils/config'
39
+
40
+ const {
41
+ // 自定义路由
42
+ routers,
43
+ } = configs
44
+
45
+ export default {
46
+
47
+ /**
48
+ * 标识
49
+ */
50
+ name: 'NRender',
51
+
52
+ /**
53
+ * 声明属性
54
+ */
55
+ props: {
56
+ // 组件标识
57
+ name: String,
58
+ // 组件路径
59
+ path: String,
60
+ // 参数
61
+ query: Object,
62
+ // 组件传参
63
+ props: Object,
64
+ },
65
+
66
+ /**
67
+ * 组合式
68
+ */
69
+ setup(props) {
70
+
71
+ // ==========【计算属性】=========================================================================================
72
+
73
+ /**
74
+ * 获取当前组件
75
+ */
76
+ const comp = computed(function () {
77
+
78
+ // 组件
79
+ let comp
80
+
81
+ // 如果是路由路径
82
+ if (props.path) {
83
+ // 获取路由组件
84
+ comp = $n_get(routers, `${$n_slash(props.path, 'start', false)}.component`)
85
+
86
+ // 如果有组件标识
87
+ } else if (props.name && $n_has(components, props.name)) {
88
+ // 获取自定义组件
89
+ comp = components[props.name]
90
+ }
91
+
92
+ // 如果没有组件
93
+ if (! comp) {
94
+ return
95
+ }
96
+
97
+ // 如果是方法, 则说明是异步组件
98
+ if ($n_isFunction(comp)) {
99
+ return defineAsyncComponent(comp)
100
+ }
101
+
102
+ // 返回组件
103
+ return comp
104
+ })
105
+
106
+ // ==========【注入】============================================================================================
107
+
108
+ // 注入数据
109
+ const data = {
110
+ // 组件标识
111
+ name: props.name,
112
+ // 参数
113
+ query: $n_isValidObject(props.query) ? props.query : {},
114
+ // 组件传参
115
+ props: props.props,
116
+ }
117
+
118
+ // 如果有路由路径
119
+ if ($n_isValidString(props.path)) {
120
+
121
+ // 获取页面路由
122
+ const $route = $n_router.resolve({
123
+ path: props.path,
124
+ query: data.query,
125
+ })
126
+
127
+ Object.assign(data, {
128
+ // 当前路由全路径
129
+ routeFullPath: $route.fullPath,
130
+ // 当前路由路径
131
+ routePath: $route.path,
132
+ // 当前路由参数
133
+ routeQuery: $route.query,
134
+ // 当前路由,
135
+ $route,
136
+ })
137
+ }
138
+
139
+ // 向后代注入数据
140
+ provide(NRenderKey, data)
141
+
142
+ // ==========【返回】=============================================================================================
143
+
144
+ return {
145
+ // 组件
146
+ comp,
147
+ }
148
+ }
149
+ }
150
+ </script>