@netang/quasar 0.0.20

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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/components/column-title/index.vue +32 -0
  4. package/components/dialog/components/index.js +6 -0
  5. package/components/dialog/components/move-to-tree/index.vue +150 -0
  6. package/components/dialog/index.vue +330 -0
  7. package/components/dialog-table/index.vue +92 -0
  8. package/components/dragger/index.vue +202 -0
  9. package/components/drawer/index.vue +262 -0
  10. package/components/field-date/index.vue +844 -0
  11. package/components/field-date/methods.js +100 -0
  12. package/components/field-table/index.vue +468 -0
  13. package/components/field-text/index.vue +167 -0
  14. package/components/field-tree/index.vue +435 -0
  15. package/components/input-number/index.vue +324 -0
  16. package/components/input-number/number.js +67 -0
  17. package/components/input-price-cent/index.vue +213 -0
  18. package/components/input-price-yuan/index.vue +179 -0
  19. package/components/layout/index.vue +119 -0
  20. package/components/list-menu/index.vue +137 -0
  21. package/components/list-menu-item/index.vue +79 -0
  22. package/components/power-data/index.vue +667 -0
  23. package/components/search/index.vue +176 -0
  24. package/components/search-item/index.vue +219 -0
  25. package/components/select/index.vue +71 -0
  26. package/components/select-filter/index.vue +75 -0
  27. package/components/table/index.vue +347 -0
  28. package/components/table-column-fixed/index.vue +68 -0
  29. package/components/table-pagination/index.vue +83 -0
  30. package/components/table-summary/index.vue +91 -0
  31. package/components/thumbnail/index.vue +87 -0
  32. package/components/toolbar/container.vue +31 -0
  33. package/components/toolbar/index.vue +405 -0
  34. package/components/uploader/index.vue +157 -0
  35. package/components/uploader-query/index.vue +731 -0
  36. package/package.json +21 -0
  37. package/sass/common.scss +165 -0
  38. package/sass/index.scss +14 -0
  39. package/sass/line.scss +39 -0
  40. package/sass/quasar/btn.scss +46 -0
  41. package/sass/quasar/common.scss +3 -0
  42. package/sass/quasar/dialog.scss +7 -0
  43. package/sass/quasar/drawer.scss +6 -0
  44. package/sass/quasar/field.scss +210 -0
  45. package/sass/quasar/loading.scss +6 -0
  46. package/sass/quasar/menu.scss +8 -0
  47. package/sass/quasar/table.scss +112 -0
  48. package/sass/quasar/toolbar.scss +22 -0
  49. package/store/index.js +32 -0
  50. package/utils/$area.js +387 -0
  51. package/utils/$auth.js +135 -0
  52. package/utils/$dialog.js +43 -0
  53. package/utils/$role.js +807 -0
  54. package/utils/$rule.js +17 -0
  55. package/utils/$search.js +336 -0
  56. package/utils/$table.js +802 -0
  57. package/utils/$tree.js +620 -0
  58. package/utils/$uploader.js +1029 -0
  59. package/utils/alert.js +10 -0
  60. package/utils/bus.js +6 -0
  61. package/utils/config.js +22 -0
  62. package/utils/confrim.js +11 -0
  63. package/utils/dict.js +44 -0
  64. package/utils/getData.js +61 -0
  65. package/utils/getFile.js +30 -0
  66. package/utils/getImage.js +136 -0
  67. package/utils/getTime.js +94 -0
  68. package/utils/http.js +251 -0
  69. package/utils/loading.js +13 -0
  70. package/utils/notify.js +13 -0
  71. package/utils/previewImage.js +8 -0
  72. package/utils/symbols.js +3 -0
  73. package/utils/timestamp.js +18 -0
  74. package/utils/toast.js +13 -0
  75. package/utils/uploader/aliyun.js +6 -0
  76. package/utils/uploader/local.js +8 -0
  77. package/utils/uploader/qiniu.js +311 -0
  78. package/utils/useAuth.js +26 -0
  79. package/utils/useRouter.js +36 -0
  80. package/utils/useUploader.js +58 -0
package/utils/alert.js ADDED
@@ -0,0 +1,10 @@
1
+ import { Dialog } from 'quasar'
2
+
3
+ /**
4
+ * 提示框
5
+ */
6
+ utils.alert = function(params) {
7
+ return Dialog.create(Object.assign({
8
+ title: '提示',
9
+ }, params))
10
+ }
package/utils/bus.js ADDED
@@ -0,0 +1,6 @@
1
+ import { EventBus } from 'quasar'
2
+
3
+ /**
4
+ * 事件总线
5
+ */
6
+ utils.bus = new EventBus()
@@ -0,0 +1,22 @@
1
+ import configData from '@/configs/production.json'
2
+
3
+ // 【开发模式】
4
+ // --------------------------------------------------
5
+ // #if IS_DEBUG && IS_DEV
6
+ import configDataDev from '@/configs/development.json'
7
+ _.merge(configData, configDataDev)
8
+ // #endif
9
+
10
+ // 【测试模式】
11
+ // --------------------------------------------------
12
+ // #if IS_DEBUG && IS_TEST
13
+ import configDataTest from '@/configs/testing.json'
14
+ _.merge(configData, configDataTest)
15
+ // #endif
16
+
17
+ /**
18
+ * 获取配置
19
+ */
20
+ utils.config = function(key = '', defaultValue = '') {
21
+ return key ? _.get(configData, key, defaultValue) : configData
22
+ }
@@ -0,0 +1,11 @@
1
+ import { Dialog } from 'quasar'
2
+
3
+ /**
4
+ * 确认框
5
+ */
6
+ utils.confirm = function(params) {
7
+ return Dialog.create(Object.assign({
8
+ title: '提示',
9
+ cancel: true,
10
+ }, params))
11
+ }
package/utils/dict.js ADDED
@@ -0,0 +1,44 @@
1
+ import dictData from '@/configs/dict.json'
2
+
3
+ /**
4
+ * 数据字典
5
+ */
6
+
7
+ // 设置字典数据
8
+ utils.dictData = dictData
9
+
10
+ /**
11
+ * 获取字典值对应的文字
12
+ */
13
+ utils.dict = function(key, value, defaultValue = '') {
14
+ if (
15
+ key
16
+ && _.has(dictData, key)
17
+ ) {
18
+ for (const item of dictData[key]) {
19
+ if (item[1] === value) {
20
+ return item[0]
21
+ }
22
+ }
23
+ }
24
+
25
+ return defaultValue
26
+ }
27
+
28
+ utils.dictOptions = function(key, textKey = 'label', valueKey = 'value') {
29
+
30
+ const lists = []
31
+
32
+ const dictItem = _.get(dictData, key, [])
33
+
34
+ for (const item of dictItem) {
35
+
36
+ const val = {}
37
+ val[textKey] = item[0]
38
+ val[valueKey] = item[1]
39
+
40
+ lists.push(val)
41
+ }
42
+
43
+ return lists
44
+ }
@@ -0,0 +1,61 @@
1
+ import { isRef } from 'vue'
2
+
3
+ /**
4
+ * 获取公共数据
5
+ */
6
+ utils.getData = async function(url, pageStatus, emptyDescription, refValue) {
7
+
8
+ const warn = _.isNil(pageStatus) || ! isRef(pageStatus)
9
+
10
+ // 如果是数组, 说明需要同时请求多个地址
11
+ // --------------------------------------------------
12
+ if (Array.isArray(url)) {
13
+
14
+ const result = await utils.http(_.map(url, function (item) {
15
+ return {
16
+ url: utils.config('commonDataUrl') + item,
17
+ warn,
18
+ }
19
+ }))
20
+
21
+ const res = []
22
+
23
+ for (const { status, data } of result) {
24
+ if (! status) {
25
+ if (! warn) {
26
+ pageStatus.value = false
27
+ }
28
+ if (! _.isNil(emptyDescription) && isRef(emptyDescription)) {
29
+ emptyDescription.value = data.msg
30
+ }
31
+ return false
32
+ }
33
+ res.push(data)
34
+ }
35
+
36
+ return res
37
+ }
38
+
39
+ // 单个请求
40
+ // --------------------------------------------------
41
+ const { status, data } = await utils.http({
42
+ url: utils.config('commonDataUrl') + url,
43
+ warn,
44
+ })
45
+ if (! status) {
46
+ if (! warn) {
47
+ pageStatus.value = false
48
+ }
49
+ if (! _.isNil(emptyDescription) && isRef(emptyDescription)) {
50
+ emptyDescription.value = data.msg
51
+ }
52
+ return false
53
+ }
54
+
55
+ // 直接设置 value
56
+ if (! _.isNil(refValue) && isRef(refValue)) {
57
+ refValue.value = data
58
+ }
59
+
60
+ return data
61
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 获取文件
3
+ */
4
+ utils.getFile = function(src) {
5
+
6
+ if (src) {
7
+
8
+ // 如果为数组, 则获取第一个
9
+ if (utils.isValidArray(src)) {
10
+ src = src[0]
11
+ }
12
+
13
+ if (utils.isValidString(src)) {
14
+
15
+ // http(s):// 或 data: 或 blob: 开头的地址
16
+ if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
17
+ return src
18
+ }
19
+
20
+ const uploaderConfig = utils.config('uploader.upload')
21
+ switch (uploaderConfig.type) {
22
+ // 七牛云
23
+ case 'qiniu':
24
+ return utils.slash(uploaderConfig.domain, 'end', true) + src
25
+ }
26
+ }
27
+ }
28
+
29
+ return ''
30
+ }
@@ -0,0 +1,136 @@
1
+ /**
2
+ * 获取图片
3
+ */
4
+ utils.getImage = function(src, params) {
5
+
6
+ if (src) {
7
+
8
+ // 如果为数组, 则获取第一个
9
+ if (utils.isValidArray(src)) {
10
+ src = src[0]
11
+
12
+ // 如果为对象
13
+ } else if (utils.isValidObject(src)) {
14
+
15
+ if (_.has(src, 'params')) {
16
+ params = src.params
17
+ }
18
+
19
+ if (_.has(src, 'img')) {
20
+ src = src.img
21
+ }
22
+ }
23
+
24
+ if (utils.isValidString(src)) {
25
+
26
+ // http(s):// 或 data: 或 blob: 开头的地址
27
+ if (/^(http(s)?:\/\/|data:|blob:)/i.test(src)) {
28
+ return src
29
+ }
30
+
31
+ // 如果为对象定义的规格
32
+ if (utils.isValidObject(params)) {
33
+
34
+ // 【自动缩放】
35
+ // 如果没有定义 w
36
+ // --------------------------------------------------
37
+ if (! _.has(params, 'w')) {
38
+
39
+ const {
40
+ width,
41
+ zoom,
42
+ } = params
43
+
44
+ // 如果自动缩放
45
+ if (zoom && width) {
46
+
47
+ let w = width
48
+
49
+ if (! utils.isNumeric(w) && _.isString(w)) {
50
+ w = w.replace('px', '')
51
+ }
52
+
53
+ if (utils.isNumeric(w)) {
54
+ w = Number(w)
55
+ if (w > 0) {
56
+
57
+ // 获取设备像素比
58
+ /* #if IS_WEB */
59
+ const devicePixelRatio = window.devicePixelRatio || 1
60
+ if (devicePixelRatio > 2) {
61
+ w *= 2
62
+ }
63
+ /* #endif */
64
+
65
+ if (w > 10) {
66
+ w = parseInt(String(w / 10)) * 10
67
+ } else {
68
+ w = parseInt(String(w))
69
+ }
70
+ params = Object.assign({}, params, { w })
71
+ }
72
+ }
73
+ }
74
+ }
75
+ // --------------------------------------------------
76
+ }
77
+
78
+ const uploaderConfig = utils.config('uploader.upload')
79
+ switch (uploaderConfig.type) {
80
+ // 七牛云
81
+ case 'qiniu':
82
+
83
+ const {
84
+ w,
85
+ h,
86
+ q,
87
+ // local,
88
+ format,
89
+ } = Object.assign({
90
+ // 宽
91
+ w: 0,
92
+ // 高
93
+ h: 0,
94
+ // 质量
95
+ q: 75,
96
+ // // 是否本地
97
+ // local: false,
98
+ // 格式
99
+ format: 'webp',
100
+ }, params)
101
+
102
+ // 如果是本地路径
103
+ // if (local) {
104
+ // return src
105
+ // }
106
+
107
+ // 裁剪图片方式
108
+ src += '?imageView2/2'
109
+
110
+ // 质量
111
+ if (q) {
112
+ src += '/q/' + q
113
+ }
114
+
115
+ // 宽
116
+ if (w) {
117
+ src += '/w/' + w
118
+ }
119
+
120
+ // 高
121
+ if (h) {
122
+ src += '/h/' + h
123
+ }
124
+
125
+ // 格式
126
+ if (format) {
127
+ src += '/format/' + format
128
+ }
129
+
130
+ return utils.slash(uploaderConfig.domain, 'end', true) + src
131
+ }
132
+ }
133
+ }
134
+
135
+ return ''
136
+ }
@@ -0,0 +1,94 @@
1
+ import { date as quasarDate } from 'quasar'
2
+
3
+ /**
4
+ * 获取时间
5
+ */
6
+ utils.getTime = function(time, params, defaultValue = '') {
7
+
8
+ if (! time) {
9
+ return utils.isValidString(params) ? params : defaultValue
10
+ }
11
+
12
+ let {
13
+ hideCurrentYear,
14
+ showSecond,
15
+ format,
16
+ calendar,
17
+ showCalendarToday,
18
+ showCalendarTime,
19
+
20
+ } = Object.assign({
21
+ // 默认格式化
22
+ format: 'MM-DD HH:mm',
23
+ // 显示秒
24
+ showSecond: false,
25
+ // 隐藏当前年份
26
+ hideCurrentYear: false,
27
+ // 日历时间
28
+ calendar: false,
29
+ // 显示日历今天
30
+ showCalendarToday: false,
31
+ // 显示日历时间
32
+ showCalendarTime: false,
33
+ }, params)
34
+
35
+ // 传入时间
36
+ const date = utils.toDate(time)
37
+
38
+ // 当前时间
39
+ const now = utils.toDate(utils.timestamp())
40
+
41
+ // 如果是自然化时间
42
+ // 如果是今天, 则显示时分秒
43
+ // 如果是昨天, 则显示昨天
44
+ // 如果是本周, 则显示星期几
45
+ // 如果是本年, 则显示某月某日
46
+ // 如果是非本年, 则显示某年某月某日
47
+ if (calendar) {
48
+
49
+ // 当前时间
50
+ let time = ''
51
+
52
+ // 如果是今年
53
+ if (quasarDate.formatDate(date, 'YYYY') === quasarDate.formatDate(now, 'YYYY')) {
54
+
55
+ // 如果是今天
56
+ const resDay = quasarDate.formatDate(date, 'YYYY-MM-DD')
57
+ if (resDay === quasarDate.formatDate(now, 'YYYY-MM-DD')) {
58
+ return showCalendarToday ? '今天' : quasarDate.formatDate(date, 'HH:mm' + (showSecond ? ':ss' : ''))
59
+ }
60
+
61
+ // 判断是否是昨天
62
+ if (resDay === quasarDate.formatDate(quasarDate.subtractFromDate(now, { days: 1 }), 'YYYY-MM-DD')) {
63
+ time = '昨天'
64
+
65
+ // 是否为本周(判断日期在本年是第几周 如果相同, 则是本周)
66
+ } else if (quasarDate.formatDate(date, 'YYYY w') === quasarDate.formatDate(now, 'YYYY w')) {
67
+ time = quasarDate.formatDate(date, 'dddd')
68
+
69
+ // 否则显示某月某日
70
+ } else {
71
+ time = quasarDate.formatDate(date, 'MM月DD日')
72
+ }
73
+
74
+ // 否则显示某年某月某日
75
+ } else {
76
+ time = quasarDate.formatDate(date, 'YYYY年MM月DD日')
77
+ }
78
+
79
+ // 是否显示日历时间
80
+ if (showCalendarTime) {
81
+ return time + ' ' + quasarDate.formatDate(date, 'HH:mm' + (showSecond ? ':ss' : ''))
82
+ }
83
+
84
+ // 否则仅显示日期
85
+ return time
86
+ }
87
+
88
+ // 如果是今年是否显示
89
+ if (! hideCurrentYear || quasarDate.formatDate(date, 'YYYY') !== quasarDate.formatDate(now, 'YYYY')) {
90
+ format = 'YYYY-' + format
91
+ }
92
+
93
+ return quasarDate.formatDate(date, format + (showSecond ? ':ss' : ''))
94
+ }
package/utils/http.js ADDED
@@ -0,0 +1,251 @@
1
+ import { isRef } from 'vue'
2
+ import axios from 'axios'
3
+ import createHttp from '@netang/utils/http'
4
+ import { stateRole } from '../store'
5
+
6
+ /**
7
+ * 初始化 http
8
+ */
9
+ utils.http = createHttp({
10
+ // 基础 url
11
+ baseUrl: utils.config('apiUrl'),
12
+ // 是否开启错误提醒(true:普通方式/false:不开启/alert:对话框方式)
13
+ warn: 'alert',
14
+ // 检查结果的 code 是否正确(前提数据类型必须为 json)
15
+ checkCode: true,
16
+ // 是否包含头部鉴权认证
17
+ token: true,
18
+ // 是否强制登录
19
+ login: true,
20
+ // 是否开启防抖(防止重复请求)
21
+ debounce: true,
22
+ // 缓存方法
23
+ storage: utils.storage,
24
+ // 是否已更新过鉴权
25
+ _isUpdatedAuthToken: false,
26
+
27
+ // 页面状态
28
+ pageStatus: null,
29
+ // 空状态描述
30
+ emptyDescription: '',
31
+
32
+ /**
33
+ * 设置参数
34
+ */
35
+ onOptions({ options, para }) {
36
+
37
+ // 取消请求
38
+ if (_.isFunction(para.onCancel)) {
39
+ const source = axios.CancelToken.source()
40
+ options.cancelToken = source.token
41
+
42
+ // 取消请求
43
+ para.onCancel(function(msg) {
44
+ // 取消请求
45
+ source.cancel(msg)
46
+ })
47
+ }
48
+
49
+ // 获取上传进度
50
+ if (para.upload === true && _.isFunction(para.onUploadProgress)) {
51
+ options.onUploadProgress = function (e) {
52
+ para.onUploadProgress(Math.round(e.loaded * 100 / e.total), e)
53
+ }
54
+ }
55
+ },
56
+
57
+ /**
58
+ * 处理请求
59
+ */
60
+ async onRequest({ options, para, onError, next }) {
61
+
62
+ // 如果无网络
63
+ // if (! utils.state.get('network').isOnline) {
64
+ // return onError({
65
+ // code: dicts.CODE__SERVER_ERROR,
66
+ // msg: '网络不给力,请检查设置后重试',
67
+ // })
68
+ // }
69
+
70
+ // const {
71
+ // // 应用版本名称
72
+ // appVersion,
73
+ // // 应用资源(wgt)的版本名称
74
+ // appWgtVersion,
75
+ // // 【自定义】app 类型(1:app-android,2:app-ios,3:web-mobile,4:web-pc)
76
+ // appType,
77
+ // } = utils.getSystemInfo()
78
+
79
+ // 如果验证 code, 说明是请求业务服务器
80
+ if (para.checkCode) {
81
+
82
+ // 加载设备信息
83
+ // if (para.device) {
84
+ // Object.assign(options.headers, {
85
+ // // app 类型(1:app-android,2:app-ios,3:web-mobile,4:web-pc)
86
+ // Apptype: appType,
87
+ // // app 版本号
88
+ // Appversion: appVersion,
89
+ // // app wgt 版本号
90
+ // Appwgtversion: appWgtVersion,
91
+ // })
92
+ // }
93
+
94
+ // 如果需要头部鉴权
95
+ if (para.token) {
96
+
97
+ // 如果已登录
98
+ if (utils.$auth.isLogin()) {
99
+ const { token } = utils.$auth.getAdminUserInfo()
100
+
101
+ // 头部添加鉴权认证
102
+ options.headers.Authorization = token
103
+
104
+ // 如果有权限
105
+ if (stateRole.value.v) {
106
+ // 头部添加权限版本号
107
+ options.headers.Rv = stateRole.value.v
108
+ }
109
+
110
+ // 否则未登录 && 如果开启强制登录, 则跳转登录页面
111
+ } else if (para.login) {
112
+ utils.$auth.pushLogin()
113
+ return false
114
+ }
115
+ }
116
+ }
117
+
118
+ // 【调试模式】
119
+ // --------------------------------------------------
120
+ // #ifdef IS_DEBUG
121
+ console.log('【请求 http】options', options)
122
+ // #endif
123
+ // --------------------------------------------------
124
+
125
+ const res = await next(await axios(options))
126
+
127
+ // 如果请求成功
128
+ if (res.status && para.checkCode && para.token) {
129
+ // 设置角色数据
130
+ utils.$role.setData(_.get(res, 'response.data.role'))
131
+ }
132
+
133
+ return res
134
+ },
135
+
136
+ /**
137
+ * 处理错误
138
+ */
139
+ onError({ data, para, r }) {
140
+
141
+ if (para.upload === true && axios.isCancel(r)) {
142
+ return {
143
+ cancel: true,
144
+ msg: r.message,
145
+ }
146
+ }
147
+
148
+ // 【调试模式】
149
+ // --------------------------------------------------
150
+ // #if IS_DEBUG
151
+ console.error('【请求错误 http error】', r?.response)
152
+ // #endif
153
+ // --------------------------------------------------
154
+
155
+ // 如果开启错误提醒
156
+ if (
157
+ para.warn !== false
158
+ && (
159
+ data.code < dicts.CODE__BUSINESS_ERROR
160
+ || data.code === dicts.CODE__SERVER_ERROR
161
+ )
162
+ ) {
163
+ // 错误消息
164
+ let message = data.msg
165
+
166
+ // 【调试模式】
167
+ // --------------------------------------------------
168
+ // #if IS_DEBUG
169
+ if (
170
+ data.code === dicts.CODE__SERVER_ERROR
171
+ && utils.isValidString(_.get(r, 'response.data'))
172
+ ) {
173
+ message = r.response.data
174
+ }
175
+ // #endif
176
+ // --------------------------------------------------
177
+
178
+ // 如果错误方式为提示框
179
+ if (para.warn === 'alert') {
180
+
181
+ // 提示框
182
+ utils.alert({
183
+ message,
184
+
185
+ // #if IS_DEBUG
186
+ // --------------------------------------------------
187
+ style: 'width:80vw;max-width:80vw;',
188
+ html: true,
189
+ // #endif
190
+ // --------------------------------------------------
191
+
192
+ })
193
+
194
+ // 否则为轻提示
195
+ } else {
196
+ // 轻提示
197
+ utils.toast({
198
+ message,
199
+
200
+ // #if IS_DEBUG
201
+ // --------------------------------------------------
202
+ html: true,
203
+ // #endif
204
+ // --------------------------------------------------
205
+ })
206
+ }
207
+ }
208
+
209
+ // 页面状态
210
+ if (! _.isNil(para.pageStatus) && isRef(para.pageStatus)) {
211
+ para.pageStatus.value = false
212
+ }
213
+
214
+ // 空状态描述
215
+ if (! _.isNil(para.emptyDescription) && isRef(para.emptyDescription)) {
216
+ para.emptyDescription.value = data.msg
217
+ }
218
+ },
219
+
220
+ /**
221
+ * 处理业务错误
222
+ */
223
+ async onBusinessError({ data, para, onHttp }) {
224
+
225
+ if (utils.indexOf([
226
+ // 状态码(411:强制退出)
227
+ dicts.CODE__LOGOUT,
228
+ // 状态码(410:token 过期需要重新鉴权)
229
+ dicts.CODE__TOKEN_EXPIRED,
230
+ // 状态码(412:当前用户账号被禁用,需要退出并重新跳转至登录页面)
231
+ dicts.CODE__ACCOUNT_DISABLED,
232
+ // 状态码(415:没有权限访问当前页面)
233
+ dicts.CODE__NO_PERMISSION,
234
+
235
+ ], data.code) > -1) {
236
+
237
+ // 轻提示
238
+ utils.toast({
239
+ message: data.msg || '请重新登录',
240
+ })
241
+
242
+ // 退出登录
243
+ utils.$auth.logout()
244
+
245
+ // 跳转登录页面
246
+ utils.$auth.pushLogin()
247
+
248
+ return false
249
+ }
250
+ },
251
+ })
@@ -0,0 +1,13 @@
1
+ import { Loading } from 'quasar'
2
+
3
+ /**
4
+ * 加载
5
+ */
6
+ utils.loading = {
7
+ show() {
8
+ Loading.show()
9
+ },
10
+ hide() {
11
+ Loading.hide()
12
+ },
13
+ }
@@ -0,0 +1,13 @@
1
+ import { Notify } from 'quasar'
2
+
3
+ /**
4
+ * 通知
5
+ */
6
+ utils.notify = function(params) {
7
+ Notify.create(Object.assign({
8
+ // 出现位置
9
+ position: 'bottom-right',
10
+ // 显示时间
11
+ timeout: 1500,
12
+ }, params))
13
+ }