@netang/quasar 0.2.12 → 0.2.13
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/components/data/index.vue +20 -20
- package/components/dragger/index.vue +203 -203
- package/components/field-date/methods.js +100 -100
- package/components/field-text/index.vue +165 -165
- package/components/list-menu/index.vue +149 -149
- package/components/list-menu-item/index.vue +79 -79
- package/components/price/index.vue +188 -188
- package/components/private/components/index.js +11 -11
- package/components/table-pagination/index.vue +192 -192
- package/components/thumbnail/index.vue +72 -72
- package/components/value-format/index.vue +274 -274
- package/configs/area3.js +1 -1
- package/docs/css/index.css +3 -3
- package/package.json +1 -1
- package/sass/line.scss +39 -39
- package/sass/quasar/btn.scss +46 -46
- package/sass/quasar/common.scss +3 -3
- package/sass/quasar/drawer.scss +6 -6
- package/sass/quasar/loading.scss +6 -6
- package/sass/quasar/toolbar.scss +22 -22
- package/store/index.js +29 -29
- package/utils/$auth.js +127 -127
- package/utils/$rule.js +13 -13
- package/utils/$ruleValid.js +10 -10
- package/utils/alert.js +12 -12
- package/utils/area.js +400 -400
- package/utils/arr.js +51 -51
- package/utils/bus.js +6 -6
- package/utils/confirm.js +11 -11
- package/utils/copy.js +30 -30
- package/utils/dictOptions.js +28 -28
- package/utils/loading.js +15 -15
- package/utils/notify.js +13 -13
- package/utils/price.js +18 -18
- package/utils/symbols.js +18 -18
- package/utils/toast.js +13 -13
- package/utils/useAuth.js +30 -30
- package/utils/useRouter.js +47 -47
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!-- 页码 -->
|
|
4
|
-
<span class="q-table__bottom-item">{{props.pagination.page}} / {{props.pagesNumber}}</span>
|
|
5
|
-
|
|
6
|
-
<!-- 第一页 -->
|
|
7
|
-
<q-btn
|
|
8
|
-
v-if="props.pagesNumber > 2"
|
|
9
|
-
:class="{ dense }"
|
|
10
|
-
icon="first_page"
|
|
11
|
-
color="grey-8"
|
|
12
|
-
round
|
|
13
|
-
dense
|
|
14
|
-
flat
|
|
15
|
-
:disable="props.isFirstPage"
|
|
16
|
-
@click="props.firstPage"
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
<!-- 上页 -->
|
|
20
|
-
<q-btn
|
|
21
|
-
:class="{ dense }"
|
|
22
|
-
icon="chevron_left"
|
|
23
|
-
color="grey-8"
|
|
24
|
-
round
|
|
25
|
-
dense
|
|
26
|
-
flat
|
|
27
|
-
:disable="props.isFirstPage"
|
|
28
|
-
@click="props.prevPage"
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
<!-- 下页 -->
|
|
32
|
-
<q-btn
|
|
33
|
-
:class="{ dense }"
|
|
34
|
-
icon="chevron_right"
|
|
35
|
-
color="grey-8"
|
|
36
|
-
round
|
|
37
|
-
dense
|
|
38
|
-
flat
|
|
39
|
-
:disable="props.isLastPage"
|
|
40
|
-
@click="props.nextPage"
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
<!-- 最后一页 -->
|
|
44
|
-
<q-btn
|
|
45
|
-
:class="{ dense }"
|
|
46
|
-
v-if="props.pagesNumber > 2"
|
|
47
|
-
icon="last_page"
|
|
48
|
-
color="grey-8"
|
|
49
|
-
round
|
|
50
|
-
dense
|
|
51
|
-
flat
|
|
52
|
-
:disable="props.isLastPage"
|
|
53
|
-
@click="props.lastPage"
|
|
54
|
-
/>
|
|
55
|
-
|
|
56
|
-
<!-- 刷新 -->
|
|
57
|
-
<q-btn
|
|
58
|
-
:class="{ dense }"
|
|
59
|
-
icon="refresh"
|
|
60
|
-
color="grey-8"
|
|
61
|
-
round
|
|
62
|
-
dense
|
|
63
|
-
flat
|
|
64
|
-
@click="tableRefresh"
|
|
65
|
-
v-if="! noRefresh && hasRefresh"
|
|
66
|
-
/>
|
|
67
|
-
|
|
68
|
-
<!-- 当前页面工具栏无权限按钮时显示 -->
|
|
69
|
-
<template v-if="! noPower && ! toolbarPowerBtns.length">
|
|
70
|
-
|
|
71
|
-
<!-- 左边侧滑菜单切换按钮-->
|
|
72
|
-
<q-btn
|
|
73
|
-
:class="{ dense }"
|
|
74
|
-
:icon="leftDrawer.icon"
|
|
75
|
-
dense
|
|
76
|
-
round
|
|
77
|
-
flat
|
|
78
|
-
@click="leftDrawer.toggle"
|
|
79
|
-
v-if="leftDrawer.showButton()"
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
<!-- 表格筛选可见列按钮 -->
|
|
83
|
-
<table-visible-columns-button
|
|
84
|
-
:class="{ dense }"
|
|
85
|
-
v-if="hasTable"
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
|
-
<!-- 右边侧滑菜单切换按钮-->
|
|
89
|
-
<q-btn
|
|
90
|
-
:class="{ dense }"
|
|
91
|
-
:icon="rightDrawer.icon"
|
|
92
|
-
dense
|
|
93
|
-
round
|
|
94
|
-
flat
|
|
95
|
-
@click="rightDrawer.toggle"
|
|
96
|
-
v-if="rightDrawer.showButton()"
|
|
97
|
-
/>
|
|
98
|
-
|
|
99
|
-
</template>
|
|
100
|
-
|
|
101
|
-
</div>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<script>
|
|
105
|
-
import { inject } from 'vue'
|
|
106
|
-
|
|
107
|
-
import TableVisibleColumnsButton from '../private/table-visible-columns-button'
|
|
108
|
-
import { NPowerKey, NTableKey } from '../../utils/symbols'
|
|
109
|
-
|
|
110
|
-
export default {
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 标识
|
|
114
|
-
*/
|
|
115
|
-
name: 'NTablePagination',
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* 容器
|
|
119
|
-
*/
|
|
120
|
-
components: {
|
|
121
|
-
TableVisibleColumnsButton,
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 声明属性
|
|
126
|
-
*/
|
|
127
|
-
props: {
|
|
128
|
-
// 传值
|
|
129
|
-
props: Object,
|
|
130
|
-
// 是否关闭权限
|
|
131
|
-
noPower: Boolean,
|
|
132
|
-
// 是否关闭刷新按钮
|
|
133
|
-
noRefresh: Boolean,
|
|
134
|
-
// 紧凑模式
|
|
135
|
-
dense: Boolean,
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 组合式
|
|
140
|
-
*/
|
|
141
|
-
setup() {
|
|
142
|
-
|
|
143
|
-
// ==========【数据】============================================================================================
|
|
144
|
-
|
|
145
|
-
// 获取权限注入
|
|
146
|
-
const $power = inject(NPowerKey)
|
|
147
|
-
const {
|
|
148
|
-
// 左边侧滑菜单数据
|
|
149
|
-
leftDrawer,
|
|
150
|
-
// 右边侧滑菜单数据
|
|
151
|
-
rightDrawer,
|
|
152
|
-
// 当前页面工具栏权限按钮
|
|
153
|
-
toolbarPowerBtns,
|
|
154
|
-
} = $power
|
|
155
|
-
|
|
156
|
-
// 获取表格注入
|
|
157
|
-
const $table = inject(NTableKey)
|
|
158
|
-
const hasTable = !! $table
|
|
159
|
-
|
|
160
|
-
const {
|
|
161
|
-
// 表格刷新
|
|
162
|
-
tableRefresh,
|
|
163
|
-
} = $table
|
|
164
|
-
|
|
165
|
-
// ==========【返回】=============================================================================================
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return {
|
|
169
|
-
// 是否有表格
|
|
170
|
-
hasTable,
|
|
171
|
-
// 是否有刷新按钮
|
|
172
|
-
hasRefresh: hasTable && !! $table.routeFullPath,
|
|
173
|
-
// 表格刷新
|
|
174
|
-
tableRefresh,
|
|
175
|
-
// 当前页面工具栏权限按钮
|
|
176
|
-
toolbarPowerBtns,
|
|
177
|
-
// 左边侧滑菜单数据
|
|
178
|
-
leftDrawer,
|
|
179
|
-
// 右边侧滑菜单数据
|
|
180
|
-
rightDrawer,
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
}
|
|
184
|
-
</script>
|
|
185
|
-
|
|
186
|
-
<style lang="scss" scoped>
|
|
187
|
-
|
|
188
|
-
// 紧凑模式
|
|
189
|
-
.dense {
|
|
190
|
-
font-size: 12px;
|
|
191
|
-
}
|
|
192
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- 页码 -->
|
|
4
|
+
<span class="q-table__bottom-item">{{props.pagination.page}} / {{props.pagesNumber}}</span>
|
|
5
|
+
|
|
6
|
+
<!-- 第一页 -->
|
|
7
|
+
<q-btn
|
|
8
|
+
v-if="props.pagesNumber > 2"
|
|
9
|
+
:class="{ dense }"
|
|
10
|
+
icon="first_page"
|
|
11
|
+
color="grey-8"
|
|
12
|
+
round
|
|
13
|
+
dense
|
|
14
|
+
flat
|
|
15
|
+
:disable="props.isFirstPage"
|
|
16
|
+
@click="props.firstPage"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<!-- 上页 -->
|
|
20
|
+
<q-btn
|
|
21
|
+
:class="{ dense }"
|
|
22
|
+
icon="chevron_left"
|
|
23
|
+
color="grey-8"
|
|
24
|
+
round
|
|
25
|
+
dense
|
|
26
|
+
flat
|
|
27
|
+
:disable="props.isFirstPage"
|
|
28
|
+
@click="props.prevPage"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<!-- 下页 -->
|
|
32
|
+
<q-btn
|
|
33
|
+
:class="{ dense }"
|
|
34
|
+
icon="chevron_right"
|
|
35
|
+
color="grey-8"
|
|
36
|
+
round
|
|
37
|
+
dense
|
|
38
|
+
flat
|
|
39
|
+
:disable="props.isLastPage"
|
|
40
|
+
@click="props.nextPage"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<!-- 最后一页 -->
|
|
44
|
+
<q-btn
|
|
45
|
+
:class="{ dense }"
|
|
46
|
+
v-if="props.pagesNumber > 2"
|
|
47
|
+
icon="last_page"
|
|
48
|
+
color="grey-8"
|
|
49
|
+
round
|
|
50
|
+
dense
|
|
51
|
+
flat
|
|
52
|
+
:disable="props.isLastPage"
|
|
53
|
+
@click="props.lastPage"
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<!-- 刷新 -->
|
|
57
|
+
<q-btn
|
|
58
|
+
:class="{ dense }"
|
|
59
|
+
icon="refresh"
|
|
60
|
+
color="grey-8"
|
|
61
|
+
round
|
|
62
|
+
dense
|
|
63
|
+
flat
|
|
64
|
+
@click="tableRefresh"
|
|
65
|
+
v-if="! noRefresh && hasRefresh"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<!-- 当前页面工具栏无权限按钮时显示 -->
|
|
69
|
+
<template v-if="! noPower && ! toolbarPowerBtns.length">
|
|
70
|
+
|
|
71
|
+
<!-- 左边侧滑菜单切换按钮-->
|
|
72
|
+
<q-btn
|
|
73
|
+
:class="{ dense }"
|
|
74
|
+
:icon="leftDrawer.icon"
|
|
75
|
+
dense
|
|
76
|
+
round
|
|
77
|
+
flat
|
|
78
|
+
@click="leftDrawer.toggle"
|
|
79
|
+
v-if="leftDrawer.showButton()"
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<!-- 表格筛选可见列按钮 -->
|
|
83
|
+
<table-visible-columns-button
|
|
84
|
+
:class="{ dense }"
|
|
85
|
+
v-if="hasTable"
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
<!-- 右边侧滑菜单切换按钮-->
|
|
89
|
+
<q-btn
|
|
90
|
+
:class="{ dense }"
|
|
91
|
+
:icon="rightDrawer.icon"
|
|
92
|
+
dense
|
|
93
|
+
round
|
|
94
|
+
flat
|
|
95
|
+
@click="rightDrawer.toggle"
|
|
96
|
+
v-if="rightDrawer.showButton()"
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<script>
|
|
105
|
+
import { inject } from 'vue'
|
|
106
|
+
|
|
107
|
+
import TableVisibleColumnsButton from '../private/table-visible-columns-button'
|
|
108
|
+
import { NPowerKey, NTableKey } from '../../utils/symbols'
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 标识
|
|
114
|
+
*/
|
|
115
|
+
name: 'NTablePagination',
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 容器
|
|
119
|
+
*/
|
|
120
|
+
components: {
|
|
121
|
+
TableVisibleColumnsButton,
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 声明属性
|
|
126
|
+
*/
|
|
127
|
+
props: {
|
|
128
|
+
// 传值
|
|
129
|
+
props: Object,
|
|
130
|
+
// 是否关闭权限
|
|
131
|
+
noPower: Boolean,
|
|
132
|
+
// 是否关闭刷新按钮
|
|
133
|
+
noRefresh: Boolean,
|
|
134
|
+
// 紧凑模式
|
|
135
|
+
dense: Boolean,
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 组合式
|
|
140
|
+
*/
|
|
141
|
+
setup() {
|
|
142
|
+
|
|
143
|
+
// ==========【数据】============================================================================================
|
|
144
|
+
|
|
145
|
+
// 获取权限注入
|
|
146
|
+
const $power = inject(NPowerKey)
|
|
147
|
+
const {
|
|
148
|
+
// 左边侧滑菜单数据
|
|
149
|
+
leftDrawer,
|
|
150
|
+
// 右边侧滑菜单数据
|
|
151
|
+
rightDrawer,
|
|
152
|
+
// 当前页面工具栏权限按钮
|
|
153
|
+
toolbarPowerBtns,
|
|
154
|
+
} = $power
|
|
155
|
+
|
|
156
|
+
// 获取表格注入
|
|
157
|
+
const $table = inject(NTableKey)
|
|
158
|
+
const hasTable = !! $table
|
|
159
|
+
|
|
160
|
+
const {
|
|
161
|
+
// 表格刷新
|
|
162
|
+
tableRefresh,
|
|
163
|
+
} = $table
|
|
164
|
+
|
|
165
|
+
// ==========【返回】=============================================================================================
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
// 是否有表格
|
|
170
|
+
hasTable,
|
|
171
|
+
// 是否有刷新按钮
|
|
172
|
+
hasRefresh: hasTable && !! $table.routeFullPath,
|
|
173
|
+
// 表格刷新
|
|
174
|
+
tableRefresh,
|
|
175
|
+
// 当前页面工具栏权限按钮
|
|
176
|
+
toolbarPowerBtns,
|
|
177
|
+
// 左边侧滑菜单数据
|
|
178
|
+
leftDrawer,
|
|
179
|
+
// 右边侧滑菜单数据
|
|
180
|
+
rightDrawer,
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
}
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style lang="scss" scoped>
|
|
187
|
+
|
|
188
|
+
// 紧凑模式
|
|
189
|
+
.dense {
|
|
190
|
+
font-size: 12px;
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<g-img
|
|
3
|
-
:spinner-size="size / 2"
|
|
4
|
-
:width="size"
|
|
5
|
-
:height="size"
|
|
6
|
-
v-bind="$attrs"
|
|
7
|
-
>
|
|
8
|
-
<!-- 插槽 -->
|
|
9
|
-
<template
|
|
10
|
-
v-for="slotName in slotNames"
|
|
11
|
-
v-slot:[slotName]
|
|
12
|
-
>
|
|
13
|
-
<slot
|
|
14
|
-
:name="slotName"
|
|
15
|
-
/>
|
|
16
|
-
</template>
|
|
17
|
-
</g-img>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import { computed } from 'vue'
|
|
22
|
-
|
|
23
|
-
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
24
|
-
|
|
25
|
-
import GImg from '../img'
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* 标识
|
|
31
|
-
*/
|
|
32
|
-
name: 'NThumbnail',
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 组件
|
|
36
|
-
*/
|
|
37
|
-
components: {
|
|
38
|
-
GImg,
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 声明属性
|
|
43
|
-
*/
|
|
44
|
-
props: {
|
|
45
|
-
// 图片尺寸
|
|
46
|
-
size: {
|
|
47
|
-
type: Number,
|
|
48
|
-
default: 40,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 组合式
|
|
54
|
-
*/
|
|
55
|
-
setup(props, { slots }) {
|
|
56
|
-
|
|
57
|
-
// ==========【计算属性】==========================================================================================
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 插槽标识
|
|
61
|
-
*/
|
|
62
|
-
const slotNames = computed(function() {
|
|
63
|
-
return $n_isValidObject(slots) ? Object.keys(slots) : []
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
// 插槽标识
|
|
68
|
-
slotNames,
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<g-img
|
|
3
|
+
:spinner-size="size / 2"
|
|
4
|
+
:width="size"
|
|
5
|
+
:height="size"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<!-- 插槽 -->
|
|
9
|
+
<template
|
|
10
|
+
v-for="slotName in slotNames"
|
|
11
|
+
v-slot:[slotName]
|
|
12
|
+
>
|
|
13
|
+
<slot
|
|
14
|
+
:name="slotName"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</g-img>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import { computed } from 'vue'
|
|
22
|
+
|
|
23
|
+
import $n_isValidObject from '@netang/utils/isValidObject'
|
|
24
|
+
|
|
25
|
+
import GImg from '../img'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 标识
|
|
31
|
+
*/
|
|
32
|
+
name: 'NThumbnail',
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 组件
|
|
36
|
+
*/
|
|
37
|
+
components: {
|
|
38
|
+
GImg,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 声明属性
|
|
43
|
+
*/
|
|
44
|
+
props: {
|
|
45
|
+
// 图片尺寸
|
|
46
|
+
size: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 40,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 组合式
|
|
54
|
+
*/
|
|
55
|
+
setup(props, { slots }) {
|
|
56
|
+
|
|
57
|
+
// ==========【计算属性】==========================================================================================
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 插槽标识
|
|
61
|
+
*/
|
|
62
|
+
const slotNames = computed(function() {
|
|
63
|
+
return $n_isValidObject(slots) ? Object.keys(slots) : []
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
// 插槽标识
|
|
68
|
+
slotNames,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|