@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.
@@ -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>