@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.
- package/_docs/docs/.vuepress/client.js +39 -0
- package/_docs/docs/.vuepress/components/test.vue +23 -0
- package/_docs/docs/.vuepress/config.js +40 -0
- package/_docs/docs/.vuepress/configs/index.js +2 -0
- package/_docs/docs/.vuepress/configs/navbar/index.js +1 -0
- package/_docs/docs/.vuepress/configs/navbar/zh.js +16 -0
- package/_docs/docs/.vuepress/configs/sidebar/index.js +1 -0
- package/_docs/docs/.vuepress/configs/sidebar/zh.js +20 -0
- package/_docs/docs/.vuepress/public/css/index.css +3 -0
- package/_docs/docs/.vuepress/styles/index.scss +3 -0
- package/_docs/docs/components/field-table.md +63 -0
- package/_docs/docs/components/field-tree.md +1 -0
- package/{docs → _docs}/docs/index.md +0 -0
- package/{docs → _docs}/docs/utils/alert.md +0 -0
- package/{docs → _docs}/docs/utils/confirm.md +0 -0
- package/_docs/docs/utils/index.md +1 -0
- package/_docs/package.json +17 -0
- package/components/column-title/index.vue +2 -2
- package/components/data/index.vue +20 -23
- package/components/dialog/index.vue +26 -12
- package/components/dialog-table/index.vue +4 -2
- package/components/dragger/index.vue +3 -2
- package/components/drawer/index.vue +16 -9
- package/components/editor-code/index.vue +12 -5
- package/components/empty/index.vue +16 -1
- package/components/field-date/index.vue +48 -36
- package/components/field-table/index.vue +69 -43
- package/components/field-text/index.vue +6 -2
- package/components/field-tree/index.vue +40 -22
- package/components/input-number/index.vue +5 -4
- package/components/list-menu/index.vue +14 -2
- package/components/power-page/index.vue +10 -0
- package/components/private/components/index.js +7 -2
- package/components/private/components/move-to-tree/index.vue +7 -3
- package/components/private/edit-power-data/index.vue +92 -52
- package/components/private/table-visible-columns-button/index.vue +6 -2
- package/components/render/index.vue +21 -7
- package/components/search/index.vue +30 -2
- package/components/search-item/index.vue +24 -8
- package/components/select/index.vue +5 -2
- package/components/splitter/index.vue +13 -9
- package/components/table/index.vue +32 -5
- package/components/table-pagination/index.vue +0 -1
- package/components/table-splitter/index.vue +22 -3
- package/components/table-summary/index.vue +10 -3
- package/components/thumbnail/index.vue +16 -6
- package/components/toolbar/index.vue +0 -2
- package/components/uploader/index.vue +5 -2
- package/components/uploader-query/index.vue +48 -27
- package/components/value-format/index.vue +19 -12
- package/configs/area3.js +1 -0
- package/docs/404.html +33 -0
- package/docs/assets/404.html-60b35caa.js +1 -0
- package/docs/assets/404.html-d1e63d77.js +1 -0
- package/docs/assets/alert.html-568d4e94.js +1 -0
- package/docs/assets/alert.html-f5dbc3e9.js +1 -0
- package/docs/assets/app-8c3ae4de.js +6 -0
- package/docs/assets/back-to-top-8efcbe56.svg +1 -0
- package/docs/assets/confirm.html-7a1566f6.js +1 -0
- package/docs/assets/confirm.html-96f1b004.js +1 -0
- package/docs/assets/field-table.html-68d610b0.js +1 -0
- package/docs/assets/field-table.html-86cc3511.js +1 -0
- package/docs/assets/field-tree.html-45410c3c.js +1 -0
- package/docs/assets/field-tree.html-c98ac993.js +1 -0
- package/docs/assets/framework-204010b2.js +5 -0
- package/docs/assets/index.html-1695dd7c.js +1 -0
- package/docs/assets/index.html-65a4aa67.js +1 -0
- package/docs/assets/style-ac5a9aa6.css +1 -0
- package/docs/components/field-table.html +33 -0
- package/docs/components/field-tree.html +33 -0
- package/docs/index.html +33 -0
- package/docs/utils/alert.html +33 -0
- package/docs/utils/confirm.html +33 -0
- package/package.json +1 -1
- package/package2.json +30 -0
- package/store/index.js +3 -20
- package/utils/alert.js +3 -1
- package/utils/area.js +27 -14
- package/utils/arr.js +6 -2
- package/utils/auth.js +40 -35
- package/utils/bus.js +1 -1
- package/utils/config.js +42 -15
- package/utils/{confrim.js → confirm.js} +1 -1
- package/utils/copy.js +18 -0
- package/utils/dialog.js +7 -3
- package/utils/dict.js +5 -28
- package/utils/dictOptions.js +24 -0
- package/utils/form.js +6 -2
- package/utils/getData.js +21 -9
- package/utils/getFile.js +11 -5
- package/utils/getImage.js +23 -12
- package/utils/getTime.js +9 -4
- package/utils/index.js +61 -0
- package/utils/loading.js +3 -1
- package/utils/notify.js +1 -1
- package/utils/power.js +164 -118
- package/utils/previewImage.js +4 -2
- package/utils/price.js +12 -3
- package/utils/rule.js +5 -9
- package/utils/ruleValid.js +10 -0
- package/utils/search.js +81 -50
- package/utils/table.js +119 -87
- package/utils/timestamp.js +2 -2
- package/utils/toast.js +1 -1
- package/utils/tree.js +69 -46
- package/utils/uploader/qiniu.js +31 -15
- package/utils/uploader.js +87 -56
- package/utils/useAuth.js +12 -5
- package/utils/useRouter.js +16 -5
- package/utils/useUploader.js +0 -5
- package/docs/docs/.vuepress/config.js +0 -32
- package/docs/docs/components/field-table.md +0 -1
- package/docs/docs/components/field-tree.md +0 -1
- package/docs/package.json +0 -11
- 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
|
-
|
|
10
|
+
export default function getFile(src) {
|
|
5
11
|
|
|
6
12
|
if (src) {
|
|
7
13
|
|
|
8
14
|
// 如果为数组, 则获取第一个
|
|
9
|
-
if ($
|
|
15
|
+
if ($n_isValidArray(src)) {
|
|
10
16
|
src = src[0]
|
|
11
17
|
}
|
|
12
18
|
|
|
13
|
-
if ($
|
|
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 =
|
|
26
|
+
const uploaderConfig = configs.uploader.upload
|
|
21
27
|
switch (uploaderConfig.type) {
|
|
22
28
|
// 七牛云
|
|
23
29
|
case 'qiniu':
|
|
24
|
-
return $
|
|
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
|
-
|
|
15
|
+
export default function getImage(src, params) {
|
|
5
16
|
|
|
6
17
|
if (src) {
|
|
7
18
|
|
|
8
19
|
// 如果为数组, 则获取第一个
|
|
9
|
-
if ($
|
|
20
|
+
if ($n_isValidArray(src)) {
|
|
10
21
|
src = src[0]
|
|
11
22
|
|
|
12
23
|
// 如果为对象
|
|
13
|
-
} else if ($
|
|
24
|
+
} else if ($n_isValidObject(src)) {
|
|
14
25
|
|
|
15
|
-
if ($
|
|
26
|
+
if ($n_has(src, 'params')) {
|
|
16
27
|
params = src.params
|
|
17
28
|
}
|
|
18
29
|
|
|
19
|
-
if ($
|
|
30
|
+
if ($n_has(src, 'img')) {
|
|
20
31
|
src = src.img
|
|
21
32
|
}
|
|
22
33
|
}
|
|
23
34
|
|
|
24
|
-
if ($
|
|
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 ($
|
|
43
|
+
if ($n_isValidObject(params)) {
|
|
33
44
|
|
|
34
45
|
// 【自动缩放】
|
|
35
46
|
// 如果没有定义 w
|
|
36
47
|
// --------------------------------------------------
|
|
37
|
-
if (! $
|
|
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 (! $
|
|
60
|
+
if (! $n_isNumeric(w) && $n_isString(w)) {
|
|
50
61
|
w = w.replace('px', '')
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
if ($
|
|
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 = $
|
|
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 $
|
|
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
|
-
|
|
11
|
+
export default function getTime(time, params, defaultValue = '') {
|
|
7
12
|
|
|
8
13
|
if (! time) {
|
|
9
|
-
return $
|
|
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 = $
|
|
41
|
+
const date = $n_toDate(time)
|
|
37
42
|
|
|
38
43
|
// 当前时间
|
|
39
|
-
const now = $
|
|
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