@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.
- package/components/dialog/img-viewer/index.vue +14 -5
- package/components/drawer/index.vue +303 -303
- package/components/field-tree/index.vue +9 -12
- package/components/toolbar/index.vue +138 -136
- package/package.json +1 -1
- package/utils/$search.js +416 -0
- package/utils/$table.js +3 -3
- package/utils/index.js +3 -0
- package/utils/uploader.js +1063 -1059
|
@@ -267,18 +267,15 @@ export default {
|
|
|
267
267
|
|
|
268
268
|
const lists = []
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
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>
|