@netang/quasar 0.0.55 → 0.0.57
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 +0 -31
- package/_docs/docs/.vuepress/configs/sidebar/zh.js +21 -0
- package/_docs/docs/components/column-title.md +10 -0
- package/_docs/docs/components/data.md +21 -0
- package/_docs/docs/components/dialog.md +23 -0
- package/_docs/docs/components/dragger.md +26 -0
- package/_docs/docs/components/editor-code.md +16 -0
- package/_docs/docs/components/empty.md +11 -0
- package/_docs/docs/components/field-date.md +16 -0
- package/_docs/docs/components/field-table.md +57 -63
- package/_docs/docs/components/field-text.md +57 -0
- package/_docs/docs/components/field-tree.md +20 -0
- package/_docs/docs/components/input-number.md +21 -0
- package/_docs/docs/components/render.md +12 -0
- package/_docs/docs/components/search-item.md +10 -0
- package/_docs/docs/components/search.md +12 -0
- package/_docs/docs/components/select.md +11 -0
- package/_docs/docs/components/splitter.md +15 -0
- package/_docs/docs/components/table-splitter.md +20 -0
- package/_docs/docs/components/table.md +25 -0
- package/_docs/docs/components/thumbnail.md +11 -0
- package/_docs/docs/components/toolbar.md +9 -0
- package/_docs/docs/components/uploader-query.md +19 -0
- package/_docs/docs/components/uploader.md +16 -0
- package/_docs/docs/components/value-format.md +26 -0
- package/_docs/package.json +11 -17
- package/components/dialog/index.vue +6 -6
- package/components/dragger/index.vue +1 -1
- package/components/editor-code/index.vue +1 -1
- package/components/field-date/index.vue +24 -15
- package/components/field-table/index.vue +6 -6
- package/components/field-tree/index.vue +5 -6
- package/components/input-number/index.vue +6 -6
- package/components/search/index.vue +3 -7
- package/components/table/index.vue +2 -2
- package/components/table-splitter/index.vue +4 -0
- package/components/thumbnail/index.vue +1 -1
- package/components/toolbar/index.vue +1 -3
- package/components/value-format/index.vue +2 -2
- package/package.json +1 -1
- package/sass/common.scss +0 -2
- package/utils/{auth.js → $auth.js} +2 -2
- package/utils/{form.js → $form.js} +2 -2
- package/utils/{power.js → $power.js} +5 -4
- package/utils/{rule.js → $rule.js} +2 -2
- package/utils/{ruleValid.js → $ruleValid.js} +2 -2
- package/utils/{search.js → $search.js} +2 -2
- package/utils/{table.js → $table.js} +9 -9
- package/utils/{tree.js → $tree.js} +2 -2
- package/utils/config.js +20 -16
- package/utils/getData.js +3 -8
- package/utils/getFile.js +8 -4
- package/utils/getImage.js +9 -3
- package/utils/index.js +18 -16
- package/utils/uploader/qiniu.js +3 -9
- package/utils/uploader.js +3 -2
- package/utils/useAuth.js +1 -5
- package/utils/useRouter.js +7 -7
- package/_docs/docs/.vuepress/components/test.vue +0 -23
- package/components/dialog-table/index.vue +0 -94
- package/package2.json +0 -30
package/utils/config.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import $n_get from 'lodash/get'
|
|
2
2
|
import $n_merge from 'lodash/merge'
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
// 用户配置 参数
|
|
6
|
+
// userConfig: {
|
|
7
|
+
// // api 请求公共数据地址
|
|
8
|
+
// apiDataUrl: '',
|
|
9
|
+
// // api 文件请求地址
|
|
10
|
+
// apiFileUrl: '',
|
|
11
|
+
// // api 请求权限标识
|
|
12
|
+
// apiDataPowerName: '',
|
|
13
|
+
// // 是否开启人民币分转元
|
|
14
|
+
// priceCentToYuan: false,
|
|
15
|
+
// // 上传器
|
|
16
|
+
// uploader: {
|
|
17
|
+
// upload: {
|
|
18
|
+
// type: '',
|
|
19
|
+
// domain: '',
|
|
20
|
+
// },
|
|
21
|
+
// },
|
|
22
|
+
// },
|
|
23
|
+
|
|
4
24
|
// 配置
|
|
5
25
|
export const configs = {
|
|
6
|
-
// api 请求公共数据地址
|
|
7
|
-
apiDataUrl: '',
|
|
8
|
-
// api 文件请求地址
|
|
9
|
-
apiFileUrl: '',
|
|
10
26
|
// 用户配置
|
|
11
27
|
userConfig: {},
|
|
12
28
|
// 用户字典
|
|
@@ -19,18 +35,6 @@ export const configs = {
|
|
|
19
35
|
tablesConfig: {},
|
|
20
36
|
// 对话框组件
|
|
21
37
|
dialogComponents: {},
|
|
22
|
-
// 是否开启人民币分转元
|
|
23
|
-
priceCentToYuan: false,
|
|
24
|
-
// 上传器
|
|
25
|
-
uploader: {
|
|
26
|
-
upload: {},
|
|
27
|
-
limit: {
|
|
28
|
-
image: {
|
|
29
|
-
maxSize: 10,
|
|
30
|
-
exts: [ 'jpg', 'png', 'gif' ]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
/**
|
package/utils/getData.js
CHANGED
|
@@ -5,12 +5,7 @@ import $n_map from 'lodash/map'
|
|
|
5
5
|
|
|
6
6
|
import $n_http from '@netang/utils/http'
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
// 请求公共数据地址
|
|
12
|
-
apiDataUrl,
|
|
13
|
-
} = configs
|
|
8
|
+
import $n_config from './config'
|
|
14
9
|
|
|
15
10
|
/**
|
|
16
11
|
* 获取公共数据
|
|
@@ -25,7 +20,7 @@ export default async function getData(url, pageStatus, emptyDescription, refValu
|
|
|
25
20
|
|
|
26
21
|
const result = await $n_http($n_map(url, function (item) {
|
|
27
22
|
return {
|
|
28
|
-
url: apiDataUrl + item,
|
|
23
|
+
url: $n_config('apiDataUrl') + item,
|
|
29
24
|
warn,
|
|
30
25
|
}
|
|
31
26
|
}))
|
|
@@ -51,7 +46,7 @@ export default async function getData(url, pageStatus, emptyDescription, refValu
|
|
|
51
46
|
// 单个请求
|
|
52
47
|
// --------------------------------------------------
|
|
53
48
|
const { status, data } = await $n_http({
|
|
54
|
-
url: apiDataUrl + url,
|
|
49
|
+
url: $n_config('apiDataUrl') + url,
|
|
55
50
|
warn,
|
|
56
51
|
})
|
|
57
52
|
if (! status) {
|
package/utils/getFile.js
CHANGED
|
@@ -2,7 +2,7 @@ import $n_isValidArray from '@netang/utils/isValidArray'
|
|
|
2
2
|
import $n_isValidString from '@netang/utils/isValidString'
|
|
3
3
|
import $n_slash from '@netang/utils/slash'
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import $n_config from './config'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* 获取文件
|
|
@@ -23,11 +23,15 @@ export default function getFile(src) {
|
|
|
23
23
|
return src
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const {
|
|
27
|
+
type,
|
|
28
|
+
domain,
|
|
29
|
+
} = $n_config('uploader.upload')
|
|
30
|
+
|
|
31
|
+
switch (type) {
|
|
28
32
|
// 七牛云
|
|
29
33
|
case 'qiniu':
|
|
30
|
-
return $n_slash(
|
|
34
|
+
return $n_slash(domain, 'end', true) + src
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
}
|
package/utils/getImage.js
CHANGED
|
@@ -86,8 +86,14 @@ export default function getImage(src, params) {
|
|
|
86
86
|
// --------------------------------------------------
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
|
|
90
|
+
const {
|
|
91
|
+
type,
|
|
92
|
+
domain,
|
|
93
|
+
} = $n_config('uploader.upload')
|
|
94
|
+
|
|
95
|
+
switch (type) {
|
|
96
|
+
|
|
91
97
|
// 七牛云
|
|
92
98
|
case 'qiniu':
|
|
93
99
|
|
|
@@ -138,7 +144,7 @@ export default function getImage(src, params) {
|
|
|
138
144
|
src += '/format/' + format
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
return $n_slash(
|
|
147
|
+
return $n_slash(domain, 'end', true) + src
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
150
|
}
|
package/utils/index.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import $auth from './$auth'
|
|
2
|
+
import $form from './$form'
|
|
3
|
+
import $power from './$power'
|
|
4
|
+
import $rule from './$rule'
|
|
5
|
+
import $ruleValid from './$ruleValid'
|
|
6
|
+
import $search from './$search'
|
|
7
|
+
import $table from './$table'
|
|
8
|
+
import $tree from './$tree'
|
|
9
|
+
|
|
1
10
|
import alert from './alert'
|
|
2
11
|
import area from './area'
|
|
3
12
|
import arr from './arr'
|
|
4
|
-
import auth from './auth'
|
|
5
13
|
import bus from './bus'
|
|
6
14
|
import config from './config'
|
|
7
15
|
import confirm from './confirm'
|
|
@@ -9,30 +17,31 @@ import copy from './copy'
|
|
|
9
17
|
import dialog from './dialog'
|
|
10
18
|
import dict from './dict'
|
|
11
19
|
import dictOptions from './dictOptions'
|
|
12
|
-
import form from './form'
|
|
13
20
|
import getData from './getData'
|
|
14
21
|
import getFile from './getFile'
|
|
15
22
|
import getImage from './getImage'
|
|
16
23
|
import getTime from './getTime'
|
|
17
24
|
import loading from './loading'
|
|
18
25
|
import notify from './notify'
|
|
19
|
-
import power from './power'
|
|
20
26
|
import previewImage from './previewImage'
|
|
21
27
|
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
28
|
import timestamp from './timestamp'
|
|
27
29
|
import toast from './toast'
|
|
28
|
-
import tree from './tree'
|
|
29
30
|
import uploader from './uploader'
|
|
30
31
|
|
|
31
32
|
export default {
|
|
33
|
+
$auth,
|
|
34
|
+
$form,
|
|
35
|
+
$power,
|
|
36
|
+
$rule,
|
|
37
|
+
$ruleValid,
|
|
38
|
+
$search,
|
|
39
|
+
$table,
|
|
40
|
+
$tree,
|
|
41
|
+
|
|
32
42
|
alert,
|
|
33
43
|
area,
|
|
34
44
|
arr,
|
|
35
|
-
auth,
|
|
36
45
|
bus,
|
|
37
46
|
config,
|
|
38
47
|
confirm,
|
|
@@ -40,22 +49,15 @@ export default {
|
|
|
40
49
|
dialog,
|
|
41
50
|
dict,
|
|
42
51
|
dictOptions,
|
|
43
|
-
form,
|
|
44
52
|
getData,
|
|
45
53
|
getFile,
|
|
46
54
|
getImage,
|
|
47
55
|
getTime,
|
|
48
56
|
loading,
|
|
49
57
|
notify,
|
|
50
|
-
power,
|
|
51
58
|
previewImage,
|
|
52
59
|
price,
|
|
53
|
-
rule,
|
|
54
|
-
ruleValid,
|
|
55
|
-
search,
|
|
56
|
-
table,
|
|
57
60
|
timestamp,
|
|
58
61
|
toast,
|
|
59
|
-
tree,
|
|
60
62
|
uploader,
|
|
61
63
|
}
|
package/utils/uploader/qiniu.js
CHANGED
|
@@ -8,13 +8,7 @@ import $n_isValidString from '@netang/utils/isValidString'
|
|
|
8
8
|
import $n_http from '@netang/utils/http'
|
|
9
9
|
|
|
10
10
|
import $n_toast from '../toast'
|
|
11
|
-
|
|
12
|
-
import { configs } from '../config'
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
// api 文件请求地址
|
|
16
|
-
apiFileUrl,
|
|
17
|
-
} = configs
|
|
11
|
+
import $n_config from '../config'
|
|
18
12
|
|
|
19
13
|
import {
|
|
20
14
|
UPLOAD_STATUS,
|
|
@@ -27,7 +21,7 @@ async function getQiniuToken(bucket = 'public') {
|
|
|
27
21
|
|
|
28
22
|
// 请求数据
|
|
29
23
|
const { status, data } = await $n_http({
|
|
30
|
-
url: apiFileUrl + 'get_qiniu_token',
|
|
24
|
+
url: $n_config('apiFileUrl') + 'get_qiniu_token',
|
|
31
25
|
data: {
|
|
32
26
|
bucket,
|
|
33
27
|
},
|
|
@@ -133,7 +127,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
|
|
|
133
127
|
|
|
134
128
|
// 请求 - 上传文件至 cdn
|
|
135
129
|
const { status: statusCallback, data: resCallback } = await $n_http({
|
|
136
|
-
url: apiFileUrl + 'upload_cdn_callback',
|
|
130
|
+
url: $n_config('apiFileUrl') + 'upload_cdn_callback',
|
|
137
131
|
data: query,
|
|
138
132
|
// 关闭错误提示
|
|
139
133
|
warn: false,
|
package/utils/uploader.js
CHANGED
|
@@ -20,11 +20,12 @@ import $n_isValidValue from '@netang/utils/isValidValue'
|
|
|
20
20
|
import $n_copy from '@netang/utils/copy'
|
|
21
21
|
import $n_http from '@netang/utils/http'
|
|
22
22
|
|
|
23
|
-
import $n_config from './config'
|
|
24
23
|
import $n_toast from './toast'
|
|
25
24
|
import $n_confirm from './confirm'
|
|
26
25
|
import $n_alert from './alert'
|
|
27
26
|
|
|
27
|
+
import $n_config from './config'
|
|
28
|
+
|
|
28
29
|
import { configs } from './config'
|
|
29
30
|
|
|
30
31
|
const {
|
|
@@ -106,7 +107,7 @@ function create(params) {
|
|
|
106
107
|
const configLimit = Object.assign({
|
|
107
108
|
maxSize: 100,
|
|
108
109
|
exts: [],
|
|
109
|
-
},
|
|
110
|
+
}, $n_config('uploader.limit.' + props.type))
|
|
110
111
|
|
|
111
112
|
// 如果有单个文件的最大大小
|
|
112
113
|
if (props.maxSize) {
|
package/utils/useAuth.js
CHANGED
package/utils/useRouter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import $n_isNil from 'lodash/isNil'
|
|
1
2
|
import $n_has from 'lodash/has'
|
|
2
3
|
import $n_get from 'lodash/get'
|
|
3
4
|
|
|
@@ -6,20 +7,19 @@ import $n_slash from '@netang/utils/slash'
|
|
|
6
7
|
|
|
7
8
|
import { configs } from './config'
|
|
8
9
|
|
|
9
|
-
const {
|
|
10
|
-
// 自定义路由
|
|
11
|
-
routers,
|
|
12
|
-
} = configs
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* 获取路由
|
|
16
12
|
*/
|
|
17
|
-
export function getRouters(mainRouter, errorRouter) {
|
|
13
|
+
export function getRouters(mainRouter, errorRouter, routers = null) {
|
|
18
14
|
|
|
19
15
|
const routes = [
|
|
20
|
-
mainRouter
|
|
16
|
+
mainRouter,
|
|
21
17
|
]
|
|
22
18
|
|
|
19
|
+
if ($n_isNil(routers)) {
|
|
20
|
+
routers = $n_get(configs, 'routers')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
23
|
$n_forIn(routers, function(item, key) {
|
|
24
24
|
|
|
25
25
|
// 如果没有 meta
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-badge color="blue">
|
|
3
|
-
#4D96F2
|
|
4
|
-
</q-badge>
|
|
5
|
-
<q-btn
|
|
6
|
-
label="test"
|
|
7
|
-
@click="onTest"
|
|
8
|
-
/>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import uniq from 'lodash/uniq'
|
|
13
|
-
import test from 'utils/test'
|
|
14
|
-
export default {
|
|
15
|
-
setup() {
|
|
16
|
-
return {
|
|
17
|
-
onTest() {
|
|
18
|
-
console.log(3333, test)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<slot
|
|
3
|
-
:click="onDialog"
|
|
4
|
-
/>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import $n_dialog from '../../utils/dialog'
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 标识
|
|
14
|
-
*/
|
|
15
|
-
name: 'NDialogTable',
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 声明属性
|
|
19
|
-
*/
|
|
20
|
-
props: {
|
|
21
|
-
// 值
|
|
22
|
-
modelValue: [String, Number, Array, Object],
|
|
23
|
-
// 标题
|
|
24
|
-
title: String,
|
|
25
|
-
// 路由组件路径
|
|
26
|
-
route: String,
|
|
27
|
-
// 宽
|
|
28
|
-
width: {
|
|
29
|
-
type: [Number, String],
|
|
30
|
-
default: '80%',
|
|
31
|
-
},
|
|
32
|
-
// 组件传参
|
|
33
|
-
props: Object,
|
|
34
|
-
// 是否多选
|
|
35
|
-
multiple: Boolean,
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 声明事件
|
|
40
|
-
*/
|
|
41
|
-
emits: [
|
|
42
|
-
'update:modelValue',
|
|
43
|
-
],
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 组合式
|
|
47
|
-
*/
|
|
48
|
-
setup(props) {
|
|
49
|
-
|
|
50
|
-
// ==========【方法】=============================================================================================
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 弹出对话框
|
|
54
|
-
*/
|
|
55
|
-
function onDialog() {
|
|
56
|
-
|
|
57
|
-
// 创建对话框
|
|
58
|
-
$n_dialog.create({
|
|
59
|
-
// 标题
|
|
60
|
-
title: props.title,
|
|
61
|
-
// 宽
|
|
62
|
-
width: props.width,
|
|
63
|
-
// width: 1000,
|
|
64
|
-
// 路由组件路径
|
|
65
|
-
route: props.route,
|
|
66
|
-
// 组件传参
|
|
67
|
-
props: Object.assign({
|
|
68
|
-
multiple: props.multiple,
|
|
69
|
-
}, props.props),
|
|
70
|
-
// 对话框传参
|
|
71
|
-
dialogProps: {
|
|
72
|
-
// 不能通过按 ESC 键关闭对话框
|
|
73
|
-
noEscDismiss: true,
|
|
74
|
-
// 不能通过在对话框外单击来关闭对话框
|
|
75
|
-
noBackdropDismiss: true,
|
|
76
|
-
},
|
|
77
|
-
// 显示取消按钮
|
|
78
|
-
cancel: true,
|
|
79
|
-
// 点击确认执行
|
|
80
|
-
async onConfirm(data) {
|
|
81
|
-
console.log('----data---', data)
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ==========【返回】=============================================================================================
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
// 弹出对话框
|
|
90
|
-
onDialog,
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
</script>
|
package/package2.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@netang/quasar",
|
|
3
|
-
"version": "0.0.54",
|
|
4
|
-
"description": "netang-quasar",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
-
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/netangsoft/netang-quasar.git"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"netang-quasar"
|
|
14
|
-
],
|
|
15
|
-
"author": "Netang",
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/netangsoft/netang-quasar/issues"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://github.com/netangsoft/netang-quasar#readme",
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@netang/node-utils": "^0.2.61",
|
|
23
|
-
"@netang/utils": "^0.4.2",
|
|
24
|
-
"@netang/vue-utils": "^3.0.23",
|
|
25
|
-
"lodash": "^4.17.21",
|
|
26
|
-
"quasar": "^2.11.5",
|
|
27
|
-
"vue": "^3.2.47",
|
|
28
|
-
"vue-router": "^4.1.6"
|
|
29
|
-
}
|
|
30
|
-
}
|