@netang/quasar 0.1.41 → 0.1.43

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.
@@ -267,18 +267,15 @@ export default {
267
267
 
268
268
  const lists = []
269
269
 
270
- if ($n_isValidObject(treeAll.value)) {
271
-
272
- for (const treeKey of treeTicked.value) {
273
-
274
- // 获取树选择的节点
275
- if ($n_has(treeAll.value, treeKey)) {
276
- lists.push({
277
- id: treeKey,
278
- label: treeAll.value[treeKey][props.showAllLevels ? 'path' : 'label'],
279
- })
280
- }
281
- }
270
+ const hasTreeAll = $n_isValidObject(treeAll.value)
271
+
272
+ for (const treeKey of treeTicked.value) {
273
+ lists.push({
274
+ id: treeKey,
275
+ label: hasTreeAll && $n_has(treeAll.value, treeKey) ?
276
+ treeAll.value[treeKey][props.showAllLevels ? 'path' : 'label']
277
+ : treeKey
278
+ })
282
279
  }
283
280
 
284
281
  return lists
@@ -1,136 +1,138 @@
1
- <template>
2
- <container
3
- :header="header"
4
- v-if="toolbarPowerBtns.length"
5
- >
6
- <q-toolbar>
7
-
8
- <!-- 左边侧滑菜单切换按钮-->
9
- <q-btn
10
- :icon="leftDrawer.icon"
11
- dense
12
- round
13
- flat
14
- @click="leftDrawer.toggle"
15
- v-if="leftDrawer.showButton()"
16
- />
17
-
18
- <!-- 左边插槽 -->
19
- <slot name="left" />
20
-
21
- <!-- 中间权限按钮 -->
22
- <q-toolbar-title>
23
- <q-scroll-area style="height:50px;">
24
- <div class="n-toolbar__body">
25
-
26
- <!-- 权限按钮 -->
27
- <template v-for="item in toolbarPowerBtns">
28
- <q-btn
29
- class="n-button-icon"
30
- :color="item.color"
31
- :outline="item.color === 'default'"
32
- :label="item.title"
33
- :icon="item.icon"
34
- v-if="! item.hidden"
35
- v-show="item.show"
36
- @click="powerBtnClick(item, tableSelected)"
37
- unelevated
38
- />
39
- </template>
40
-
41
- <!-- 中间权限按钮插槽 -->
42
- <slot />
43
- </div>
44
- </q-scroll-area>
45
- </q-toolbar-title>
46
-
47
- <!-- 右边插槽 -->
48
- <slot name="right" />
49
-
50
- <!-- 表格筛选可见列按钮 -->
51
- <table-visible-columns-button v-if="hasTable" />
52
-
53
- <!-- 右边侧滑菜单切换按钮-->
54
- <q-btn
55
- :icon="rightDrawer.icon"
56
- dense
57
- round
58
- flat
59
- @click="rightDrawer.toggle"
60
- v-if="rightDrawer.showButton()"
61
- />
62
-
63
- </q-toolbar>
64
- </container>
65
- </template>
66
-
67
- <script>
68
- import { inject } from 'vue'
69
-
70
- import Container from './container'
71
- import TableVisibleColumnsButton from '../private/table-visible-columns-button'
72
-
73
- import { NPowerKey, NTableKey } from '../../utils/symbols'
74
-
75
- export default {
76
-
77
- /**
78
- * 标识
79
- */
80
- name: 'NToolbar',
81
-
82
- /**
83
- * 容器
84
- */
85
- components: {
86
- Container,
87
- TableVisibleColumnsButton,
88
- },
89
-
90
- /**
91
- * 声明属性
92
- */
93
- props: {
94
- // 是否头部工具栏
95
- header: Boolean,
96
- },
97
-
98
- /**
99
- * 组合式
100
- */
101
- setup() {
102
-
103
- // ==========【数据】============================================================================================
104
-
105
- // 获取权限注入数据
106
- const $power = inject(NPowerKey)
107
-
108
- // 获取表格注入数据
109
- const $table = inject(NTableKey)
110
-
111
- // ==========【返回】=============================================================================================
112
-
113
- return {
114
- // 解构权限实例
115
- ...$power,
116
- // 是否有表格
117
- hasTable: !! $table,
118
- }
119
- },
120
- }
121
- </script>
122
-
123
- <style lang="scss">
124
- .n-toolbar {
125
- &__body {
126
- .q-btn {
127
- margin-top: 7px;
128
-
129
- // 非第一个子节点
130
- &:not(:first-child) {
131
- margin-left: 7px;
132
- }
133
- }
134
- }
135
- }
136
- </style>
1
+ <template>
2
+ <container
3
+ :header="header"
4
+ v-if="show || toolbarPowerBtns.length"
5
+ >
6
+ <q-toolbar>
7
+
8
+ <!-- 左边侧滑菜单切换按钮-->
9
+ <q-btn
10
+ :icon="leftDrawer.icon"
11
+ dense
12
+ round
13
+ flat
14
+ @click="leftDrawer.toggle"
15
+ v-if="leftDrawer.showButton()"
16
+ />
17
+
18
+ <!-- 左边插槽 -->
19
+ <slot name="left" />
20
+
21
+ <!-- 中间权限按钮 -->
22
+ <q-toolbar-title>
23
+ <q-scroll-area style="height:50px;">
24
+ <div class="n-toolbar__body">
25
+
26
+ <!-- 权限按钮 -->
27
+ <template v-for="item in toolbarPowerBtns">
28
+ <q-btn
29
+ class="n-button-icon"
30
+ :color="item.color"
31
+ :outline="item.color === 'default'"
32
+ :label="item.title"
33
+ :icon="item.icon"
34
+ v-if="! item.hidden"
35
+ v-show="item.show"
36
+ @click="powerBtnClick(item, tableSelected)"
37
+ unelevated
38
+ />
39
+ </template>
40
+
41
+ <!-- 中间权限按钮插槽 -->
42
+ <slot />
43
+ </div>
44
+ </q-scroll-area>
45
+ </q-toolbar-title>
46
+
47
+ <!-- 右边插槽 -->
48
+ <slot name="right" />
49
+
50
+ <!-- 表格筛选可见列按钮 -->
51
+ <table-visible-columns-button v-if="hasTable" />
52
+
53
+ <!-- 右边侧滑菜单切换按钮-->
54
+ <q-btn
55
+ :icon="rightDrawer.icon"
56
+ dense
57
+ round
58
+ flat
59
+ @click="rightDrawer.toggle"
60
+ v-if="rightDrawer.showButton()"
61
+ />
62
+
63
+ </q-toolbar>
64
+ </container>
65
+ </template>
66
+
67
+ <script>
68
+ import { inject } from 'vue'
69
+
70
+ import Container from './container'
71
+ import TableVisibleColumnsButton from '../private/table-visible-columns-button'
72
+
73
+ import { NPowerKey, NTableKey } from '../../utils/symbols'
74
+
75
+ export default {
76
+
77
+ /**
78
+ * 标识
79
+ */
80
+ name: 'NToolbar',
81
+
82
+ /**
83
+ * 容器
84
+ */
85
+ components: {
86
+ Container,
87
+ TableVisibleColumnsButton,
88
+ },
89
+
90
+ /**
91
+ * 声明属性
92
+ */
93
+ props: {
94
+ // 是否头部工具栏
95
+ header: Boolean,
96
+ // 是否强制显示
97
+ show: Boolean,
98
+ },
99
+
100
+ /**
101
+ * 组合式
102
+ */
103
+ setup() {
104
+
105
+ // ==========【数据】============================================================================================
106
+
107
+ // 获取权限注入数据
108
+ const $power = inject(NPowerKey)
109
+
110
+ // 获取表格注入数据
111
+ const $table = inject(NTableKey)
112
+
113
+ // ==========【返回】=============================================================================================
114
+
115
+ return {
116
+ // 解构权限实例
117
+ ...$power,
118
+ // 是否有表格
119
+ hasTable: !! $table,
120
+ }
121
+ },
122
+ }
123
+ </script>
124
+
125
+ <style lang="scss">
126
+ .n-toolbar {
127
+ &__body {
128
+ .q-btn {
129
+ margin-top: 7px;
130
+
131
+ // 非第一个子节点
132
+ &:not(:first-child) {
133
+ margin-left: 7px;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"