@das-fed/web-components 7.0.2-beta.7 → 7.0.2-beta.9
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/README.md +318 -75
- package/{index-hEsxmVUK.js → index--2ZGbR5y.js} +1 -1
- package/{index-D2OsFj-L.js → index-4OdkCGKG.js} +1 -1
- package/{index-Clzbk-Db.js → index-BC9W8aX3.js} +1 -1
- package/{index-UGFMiimH.js → index-BVOFy8TS.js} +1 -1
- package/{index-DzyIOrZm.js → index-BYkT0KTA.js} +1 -1
- package/{index-DVg_t4TN.js → index-BbmU_A-p.js} +1 -1
- package/{index-DvAZypBt.js → index-BdLFiHk_.js} +1 -1
- package/{index-CB8e1gEy.js → index-BfjRVudN.js} +1 -1
- package/{index-DiIWBbGX.js → index-BmQpLk5K.js} +4838 -4822
- package/{index-BvdzuL3A.js → index-BnmU30zt.js} +1 -1
- package/{index-CctFz-GP.js → index-BnyijbAC.js} +1 -1
- package/{index-Z46yugXh.js → index-BpJMoqI0.js} +1 -1
- package/{index-BNanjjQw.js → index-ByjdHz01.js} +1 -1
- package/{index-BnHkSFL5.js → index-C6kpUmp6.js} +1 -1
- package/{index-BkAQKFFw.js → index-CBchLLg8.js} +1 -1
- package/{index-Bm-uubY9.js → index-CGjALXlt.js} +1 -1
- package/{index-D4xsiLA3.js → index-CGujKBaJ.js} +1 -1
- package/{index-ChSXmBTv.js → index-CMPfIysk.js} +1 -1
- package/{index-CzNh5Z5x.js → index-CQkrkcUr.js} +1 -1
- package/{index-BMhuvK1s.js → index-C_9PTspt.js} +1 -1
- package/{index-CMJI-EX5.js → index-Cj-LUalT.js} +1 -1
- package/{index-DEpP7Tpa.js → index-CjZjB1Wd.js} +1 -1
- package/{index-eb-0a5_I.js → index-CujWuqtr.js} +1 -1
- package/{index-4w8mVWU3.js → index-CzpfY53L.js} +1 -1
- package/{index-CjljLd68.js → index-DAmk_trX.js} +1 -1
- package/{index-CqIJ07WA.js → index-DCWODXWy.js} +1 -1
- package/{index-CzuRKZxA.js → index-DJj1v2xZ.js} +1 -1
- package/{index-CV7zhJ8x.js → index-DMBbsu3Z.js} +1 -1
- package/{index-pImsU-kf.js → index-DNG9y7o6.js} +1 -1
- package/{index-RngNSOFU.js → index-DQSVZH0h.js} +1 -1
- package/{index-D0fghyzP.js → index-DR_jd-Qx.js} +1 -1
- package/{index-BHSe0UW2.js → index-DivR-5WK.js} +1 -1
- package/{index-CVYUdZZD.js → index-DqyWz7b_.js} +1 -1
- package/{index-C9YzODcw.js → index-Dr88wd_E.js} +1 -1
- package/{index-BZoslzj5.js → index-Dv967MbT.js} +1 -1
- package/{index-CWSOErkO.js → index-DyK0AZn-.js} +1 -1
- package/{index-DfJPGAPm.js → index-Dzil2BX-.js} +1 -1
- package/{index-oIKryPlJ.js → index-GABsZbWX.js} +1 -1
- package/{index-C928Ma6y.js → index-Gyh_9mv3.js} +1 -1
- package/{index-BgSsLMah.js → index-HbATV2a1.js} +1 -1
- package/{index-DlxCjuMX.js → index-TLihuaJF.js} +1 -1
- package/{index-CCEDPLnc.js → index-ZG-GPppi.js} +1 -1
- package/{index-C1PnKzO9.js → index-__Jv_CfA.js} +1 -1
- package/{index-B3WGxMyh.js → index-cmeMwPXM.js} +48 -48
- package/{index-CYZ7ILlC.js → index-nLxz0EgF.js} +1 -1
- package/{index-Dchn6caQ.js → index-nRfde738.js} +1 -1
- package/{index-C_DXEjvE.js → index-p89RMlbd.js} +1 -1
- package/{index-ChlWewql.js → index-phpHEQ8y.js} +1 -1
- package/{index-BebIp2A9.js → index-uhL8a3ol.js} +1 -1
- package/{index-DPLzVPg8.js → index-xUYMHBol.js} +1 -1
- package/index.js +2 -2
- package/package.json +6 -6
- package/style.css +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
## das-ce-tabs 使用方法
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
1. **引入 `das-ce-tabs` 组件并注册**。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```js
|
|
6
|
+
import { createCeTabs } from '@das-fed/web-components'
|
|
7
|
+
createCeTabs('das-ce-tabs')
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
2. **定义 `options` 和 `modelValue` 属性**。
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
`das-ce-tabs` 接收 `options` 和 `modelValue` 属性,`options` 属性配置如下:
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
interface TabOption {
|
|
16
|
+
/** 唯一标识 */
|
|
17
|
+
key: string | number
|
|
18
|
+
/** 选项卡头显示文字 */
|
|
19
|
+
tab: string
|
|
20
|
+
/** 是否禁用 */
|
|
21
|
+
disabled?: boolean
|
|
22
|
+
/** 是否隐藏 */
|
|
23
|
+
hidden?: boolean
|
|
24
|
+
/** 被隐藏时是否渲染 DOM 结构 */
|
|
25
|
+
forceRender?: boolean
|
|
26
|
+
/** tab显示文字插槽 */
|
|
27
|
+
tabSlot?: string
|
|
28
|
+
/** 关闭图标插槽 */
|
|
29
|
+
closeIconSlot?: string
|
|
30
|
+
/** 显示内容插槽 */
|
|
31
|
+
contentSlot?: string
|
|
32
|
+
}
|
|
33
|
+
```
|
|
8
34
|
|
|
9
|
-
|
|
35
|
+
定义实例如下:
|
|
10
36
|
|
|
11
|
-
|
|
37
|
+
```js
|
|
38
|
+
const activeKey = ref(1)
|
|
39
|
+
|
|
40
|
+
const options = ref([
|
|
41
|
+
{ key: 1, tab: 'Tab 1' },
|
|
42
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
43
|
+
{ key: 3, tab: 'Tab 3' },
|
|
44
|
+
])
|
|
45
|
+
```
|
|
12
46
|
|
|
13
|
-
|
|
14
|
-
- 通过 `createCeTabs('das-ce-tabs')` 注册。
|
|
15
|
-
- 主要属性:
|
|
16
|
-
- `options`:页签配置数组,支持禁用、隐藏、插槽等。
|
|
17
|
-
- `modelValue`:当前激活页签 key。
|
|
18
|
-
- 主要事件:
|
|
19
|
-
- `update:modelValue`:切换页签时触发,返回新激活 key。
|
|
20
|
-
- `tabClick`:点击页签时触发,返回 key。
|
|
21
|
-
- `tabDelete`:删除页签时触发,返回 key。
|
|
22
|
-
- `menuClick`:右键菜单操作,返回操作项和页签对象。
|
|
23
|
-
- `pageRefresh`:点击刷新按钮时触发。
|
|
24
|
-
- `toggleFullScreen`:切换全屏。
|
|
25
|
-
- 主要方法与类型定义见下方代码示例。
|
|
47
|
+
3. **监听组件事件**
|
|
26
48
|
|
|
27
|
-
|
|
49
|
+
使用组件时,监听到的事件对象为 `customEvent` ,该对象中的 `detail` 属性是个数组,数组元素为组件事件的返回值。 `das-ce-tabs` 组件暴露了以下事件:
|
|
50
|
+
|
|
51
|
+
1. `update:modelValue`:当 `modelValue` 属性变化时触发,要实现切换页签时 `activeKey` 属性自动变化,需要监听该事件。
|
|
28
52
|
|
|
29
53
|
```js
|
|
30
54
|
import { ref } from 'vue'
|
|
31
|
-
import { createCeTabs } from '@das-fed/web
|
|
55
|
+
import { createCeTabs } from '@das-fed/web-/components'
|
|
32
56
|
createCeTabs('das-ce-tabs')
|
|
33
57
|
|
|
34
58
|
const activeKey = ref(1)
|
|
59
|
+
|
|
35
60
|
const options = ref([
|
|
36
61
|
{ key: 1, tab: 'Tab 1' },
|
|
37
62
|
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
@@ -39,66 +64,296 @@ const options = ref([
|
|
|
39
64
|
])
|
|
40
65
|
```
|
|
41
66
|
|
|
67
|
+
```html
|
|
68
|
+
<das-ce-tabs
|
|
69
|
+
:modelValue="activeKey"
|
|
70
|
+
:options="options"
|
|
71
|
+
@update:modelValue="(customEvent) => (activeKey = customEvent.detail[0])"
|
|
72
|
+
></das-ce-tabs>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
2. `tabClick`:当 `tab` 被点击时触发。返回被点击页签的 `key` 值。
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
import { ref } from 'vue'
|
|
79
|
+
import { createCeTabs } from '@das-fed/web-components/components'
|
|
80
|
+
createCeTabs('das-ce-tabs')
|
|
81
|
+
|
|
82
|
+
const activeKey = ref(1)
|
|
83
|
+
|
|
84
|
+
const options = ref([
|
|
85
|
+
{ key: 1, tab: 'Tab 1' },
|
|
86
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
87
|
+
{ key: 3, tab: 'Tab 3' },
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
const tabClick = (customEvent) => {
|
|
91
|
+
console.log('当前点击页签的key: ', customEvent.detail[0])
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<das-ce-tabs :modelValue="activeKey" :options="options" @tabClick="tabClick"></das-ce-tabs>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
3. `tabDelete`:当 `tab` 被删除时触发。返回被删除页签的 `key` 值。
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
import { ref } from 'vue'
|
|
103
|
+
import { createCeTabs } from '@das-fed/web-components/components'
|
|
104
|
+
createCeTabs('das-ce-tabs')
|
|
105
|
+
|
|
106
|
+
const activeKey = ref(1)
|
|
107
|
+
|
|
108
|
+
const options = ref([
|
|
109
|
+
{ key: 1, tab: 'Tab 1' },
|
|
110
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
111
|
+
{ key: 3, tab: 'Tab 3' },
|
|
112
|
+
])
|
|
113
|
+
|
|
114
|
+
const tabDelete = (customEvent) => {
|
|
115
|
+
console.log('当前删除页签的key:', customEvent.detail[0])
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<das-ce-tabs :modelValue="activeKey" :options="options" @tabDelete="tabDelete"></das-ce-tabs>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
4. `menuClick`:当右键呼出的操作项选中时触发。返回被选中的操作项和当前右键操作的页签对象。
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
import { ref } from 'vue'
|
|
127
|
+
import { createCeTabs } from '@das-fed/web-components/components'
|
|
128
|
+
createCeTabs('das-ce-tabs')
|
|
129
|
+
|
|
130
|
+
const activeKey = ref(1)
|
|
131
|
+
|
|
132
|
+
const options = ref([
|
|
133
|
+
{ key: 1, tab: 'Tab 1' },
|
|
134
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
135
|
+
{ key: 3, tab: 'Tab 3' },
|
|
136
|
+
])
|
|
137
|
+
|
|
138
|
+
const menuClick = (customEvent) => {
|
|
139
|
+
console.log('当前选中操作项:', customEvent.detail[0], '当前页签对象:', customEvent.detail[1])
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
42
143
|
```html
|
|
43
144
|
<das-ce-tabs :modelValue="activeKey" :options="options" @menuClick="menuClick"></das-ce-tabs>
|
|
44
145
|
```
|
|
45
146
|
|
|
46
|
-
|
|
147
|
+
操作项定义如下:
|
|
47
148
|
|
|
48
149
|
```js
|
|
49
150
|
interface MenuListType {
|
|
151
|
+
/** 唯一标识 */
|
|
50
152
|
key: string | number
|
|
153
|
+
/** 操作项名称 */
|
|
51
154
|
name: string
|
|
155
|
+
/** 是否隐藏 */
|
|
52
156
|
hidden?: boolean | Function
|
|
157
|
+
/** 是否禁用 */
|
|
53
158
|
disabled?: boolean | Function
|
|
54
159
|
}
|
|
55
160
|
```
|
|
56
161
|
|
|
57
|
-
|
|
162
|
+
5. `pageRefresh`: 当点击右侧刷新按钮时触发。无返回值。
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
import { ref } from 'vue'
|
|
166
|
+
import { createCeTabs } from '@das-fed/web-components/components'
|
|
167
|
+
createCeTabs('das-ce-tabs')
|
|
168
|
+
|
|
169
|
+
const activeKey = ref(1)
|
|
170
|
+
|
|
171
|
+
const options = ref([
|
|
172
|
+
{ key: 1, tab: 'Tab 1' },
|
|
173
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
174
|
+
{ key: 3, tab: 'Tab 3' },
|
|
175
|
+
])
|
|
176
|
+
|
|
177
|
+
const pageRefresh = () => {
|
|
178
|
+
console.log('刷新')
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<das-ce-tabs :modelValue="activeKey" :options="options" @pageRefresh="pageRefresh"></das-ce-tabs>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
6. `toggleFullScreen`: 切换全屏状态。无返回值。
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
import { ref } from 'vue'
|
|
190
|
+
import { createCeTabs } from '@das-fed/web-components/components'
|
|
191
|
+
createCeTabs('das-ce-tabs')
|
|
192
|
+
|
|
193
|
+
const activeKey = ref(1)
|
|
194
|
+
|
|
195
|
+
const options = ref([
|
|
196
|
+
{ key: 1, tab: 'Tab 1' },
|
|
197
|
+
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
198
|
+
{ key: 3, tab: 'Tab 3' },
|
|
199
|
+
])
|
|
200
|
+
|
|
201
|
+
const toggleFullScreen = () => {
|
|
202
|
+
console.log('全屏')
|
|
203
|
+
}
|
|
204
|
+
```
|
|
58
205
|
|
|
59
|
-
|
|
206
|
+
```html
|
|
207
|
+
<das-ce-tabs :modelValue="activeKey" :options="options" @toggleFullScreen="toggleFullScreen"></das-ce-tabs>
|
|
208
|
+
```
|
|
60
209
|
|
|
61
|
-
-
|
|
62
|
-
- 通过 `createCeNav('das-ce-nav')` 注册。
|
|
63
|
-
- 主要属性:
|
|
64
|
-
- `modelValue`:当前选中菜单 key。
|
|
65
|
-
- `config`:导航栏配置。
|
|
66
|
-
- `logoUrl`、`searchConfig`、`userInfoConfig`、`projectTreeConfig`、`innerPagesConfig` 等。
|
|
67
|
-
- 主要事件:
|
|
68
|
-
- `handleTabClick`、`handleTabDelete`、`changeInnerPage`、`searchToPage`、`clearSearchList`、`deleteSearchItem`、`userCommandHandle`、`changeTreeHandle`。
|
|
69
|
-
- 详细属性与事件见下方表格。
|
|
210
|
+
## das-ce-nav 使用方法
|
|
70
211
|
|
|
71
|
-
|
|
212
|
+
### 1. **引入 `das-ce-nav` 组件并注册**。
|
|
72
213
|
|
|
73
214
|
```js
|
|
74
215
|
import { createCeNav } from '@das-fed/web-components'
|
|
75
216
|
createCeNav('das-ce-nav')
|
|
76
217
|
```
|
|
77
218
|
|
|
219
|
+
#### ① 在 vue 文件中使用
|
|
220
|
+
|
|
78
221
|
```html
|
|
79
222
|
<das-ce-nav
|
|
80
223
|
@update:modelValue="(event) => (activeKey = event.detail[0])"
|
|
81
224
|
:modelValue="activeKey"
|
|
225
|
+
@handleTabClick="handleTabClick"
|
|
226
|
+
@handleTabDelete="handleTabDelete"
|
|
82
227
|
:config="config"
|
|
83
228
|
:logoUrl="logoUrl"
|
|
84
229
|
:searchConfig="searchConfig"
|
|
230
|
+
@searchToPage="searchToPage"
|
|
231
|
+
@clearSearchList="clearSearchList"
|
|
232
|
+
@deleteSearchItem="deleteSearchItem"
|
|
85
233
|
:userInfoConfig="userInfoConfig"
|
|
234
|
+
@userCommandHandle="userCommandHandle"
|
|
86
235
|
:projectTreeConfig="projectTreeConfig"
|
|
236
|
+
@changeTreeHandle="changeTreeHandle"
|
|
87
237
|
:innerPagesConfig="innerPagesConfig"
|
|
238
|
+
@changeInnerPage="changeInnerPage"
|
|
88
239
|
></das-ce-nav>
|
|
89
240
|
```
|
|
90
241
|
|
|
91
|
-
####
|
|
242
|
+
#### ① 在 html 文件中使用
|
|
243
|
+
|
|
244
|
+
```html
|
|
245
|
+
<head>
|
|
246
|
+
<script type="module">
|
|
247
|
+
import { createCeNav } from '@das-fed/web-components'
|
|
248
|
+
createCeNav('das-ce-nav')
|
|
249
|
+
const handleTabClick = (event) => {
|
|
250
|
+
console.log(event)
|
|
251
|
+
}
|
|
252
|
+
const dasceNavEle = document.getElementsByTagName('das-ce-nav')[0]
|
|
253
|
+
dasceNavEle.addEventListener('handleTabClick', handleTabClick)
|
|
254
|
+
</script>
|
|
255
|
+
</head>
|
|
256
|
+
<body>
|
|
257
|
+
<das-ce-nav
|
|
258
|
+
@update:modelValue="(event) => (activeKey = event.detail[0])"
|
|
259
|
+
:modelValue="activeKey"
|
|
260
|
+
:config="config"
|
|
261
|
+
:logoUrl="logoUrl"
|
|
262
|
+
:searchConfig="searchConfig"
|
|
263
|
+
:userInfoConfig="userInfoConfig"
|
|
264
|
+
:projectTreeConfig="projectTreeConfig"
|
|
265
|
+
:innerPagesConfig="innerPagesConfig"
|
|
266
|
+
></das-ce-nav>
|
|
267
|
+
</body>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### 2. **属性**
|
|
271
|
+
|
|
272
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
273
|
+
| ----------------- | ------------- | ----------------------------------------- | ----------------------------------------- | -------- |
|
|
274
|
+
| modelValue | 当前选中菜单 | string/number | - | 是 |
|
|
275
|
+
| config | 导航栏配置 | [config](###config) | [config](###config) | 是 |
|
|
276
|
+
| logoUrl | logo 图片链接 | string | - | 否 |
|
|
277
|
+
| innerPagesConfig | 内置页面配置 | [innerPagesConfig](###innerPagesConfig) | [innerPagesConfig](###innerPagesConfig) | 否 |
|
|
278
|
+
| searchConfig | 搜索配置 | [searchConfig](###searchConfig) | [searchConfig](###searchConfig) | 否 |
|
|
279
|
+
| userInfoConfig | 用户信息配置 | [userInfoConfig](###userInfoConfig) | [userInfoConfig](###userInfoConfig) | 否 |
|
|
280
|
+
| projectTreeConfig | 项目树配置 | [projectTreeConfig](###projectTreeConfig) | [projectTreeConfig](###projectTreeConfig) | 否 |
|
|
281
|
+
|
|
282
|
+
### config
|
|
283
|
+
|
|
284
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
285
|
+
| --------------- | ------------------ | ---------------------------------- | ------ | -------- |
|
|
286
|
+
| showSearch | 是否显示搜索 | bool | false | 否 |
|
|
287
|
+
| showProjectTree | 是否显示项目下拉树 | bool | false | 否 |
|
|
288
|
+
| subAppList | 导航栏菜单数据 | {name:string,code:string/number}[] | - | 否 |
|
|
289
|
+
|
|
290
|
+
### innerPagesConfig
|
|
291
|
+
|
|
292
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
293
|
+
| ------------------- | ------------------ | ------------------------------- | ------ | -------- |
|
|
294
|
+
| activeInnerPagePath | 内置菜单当前选中值 | string/number | false | 否 |
|
|
295
|
+
| innerPages | 内置菜单数据 | {title: string, path: string}[] | false | 否 |
|
|
296
|
+
|
|
297
|
+
### searchConfig
|
|
298
|
+
|
|
299
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
300
|
+
| -------------- | ---------------- | ----------------------------- | --------------------------- | -------- |
|
|
301
|
+
| defaultProps | - | {value: string,label: string} | {value: 'id',label: 'name'} | 否 |
|
|
302
|
+
| getHistoryList | 获取历史搜索记录 | () => Promise<any> | - | 否 |
|
|
303
|
+
| getSearchList | 获取菜单 | () => Promise<any> | - | 否 |
|
|
304
|
+
| addHistory | 添加历史记录 | (data:any) => void | - | 否 |
|
|
305
|
+
|
|
306
|
+
### userInfoConfig
|
|
307
|
+
|
|
308
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
309
|
+
| ------------- | -------------- | -------------------------------------------------- | ------ | -------- |
|
|
310
|
+
| headPicture | 用户头像 | 默认头像 | 否 |
|
|
311
|
+
| commandList | 用户信息操作项 | () => Promise<any> | - | 否 |
|
|
312
|
+
| getSearchList | 获取菜单 | {value?: string /number,label?: string / number}[] | - | 否 |
|
|
313
|
+
|
|
314
|
+
### projectTreeConfig
|
|
315
|
+
|
|
316
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
317
|
+
| ------------------- | ---------------------------------- | ------------------------------------------------------------------ | --------------------------- | -------- |
|
|
318
|
+
| projectStore | 项目数据 | - | 否 |
|
|
319
|
+
| defaultProps | - | {value: string,label: string} | {value: 'id',label: 'name'} | 否 |
|
|
320
|
+
| treeProps | 树组件配置 | [TreeOptionProps](###TreeOptionProps) | - | 否 |
|
|
321
|
+
| filterNode | 搜索过滤 | (value: any, data: any) => [projectTreeType](###projectTreeType)[] | - | 否 |
|
|
322
|
+
| filterFlatCondition | 树切换平铺,符合条件的加入平铺列表 | (data: any) => boolean[] | - | 否 |
|
|
323
|
+
|
|
324
|
+
### TreeOptionProps
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
interface TreeOptionProps {
|
|
328
|
+
label?: string // 默认name
|
|
329
|
+
pathName?: string // 默认pathName
|
|
330
|
+
children?: string // 默认children
|
|
331
|
+
parentId?: string // 默认parentId
|
|
332
|
+
disabled?: string | ((data: TreeNodeData, node?: Node) => boolean) // 默认disabled
|
|
333
|
+
isLeaf?: string | ((data: TreeNodeData, node?: Node) => boolean) // 默认leaf;懒加载不支持方法
|
|
334
|
+
// 允许取消选中(keepSelected为true时生效)
|
|
335
|
+
allowUnSelect?: string | ((data: TreeNodeData) => boolean) // 默认allowUnSelect
|
|
336
|
+
class?: (
|
|
337
|
+
data: TreeNodeData,
|
|
338
|
+
node: Node,
|
|
339
|
+
) =>
|
|
340
|
+
| string
|
|
341
|
+
| {
|
|
342
|
+
[key: string]: boolean
|
|
343
|
+
}
|
|
344
|
+
| string
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### projectTreeType
|
|
349
|
+
|
|
350
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
351
|
+
| -------- | ------------------------------------------ | ------------------------------------- | ------ | -------- |
|
|
352
|
+
| - | 唯一标识(可使用 defaultProps.value 配置) | id | 是 |
|
|
353
|
+
| - | 项目名称(可使用 defaultProps.label 配置) | name | 是 |
|
|
354
|
+
| children | 树组件配置 | [projectTreeType](###projectTreeType) | - | 否 |
|
|
92
355
|
|
|
93
|
-
|
|
94
|
-
| ----------------- | ------------- | ------------- | -------- |
|
|
95
|
-
| modelValue | 当前选中菜单 | string/number | 是 |
|
|
96
|
-
| config | 导航栏配置 | object | 是 |
|
|
97
|
-
| logoUrl | logo 图片链接 | string | 否 |
|
|
98
|
-
| innerPagesConfig | 内置页面配置 | object | 否 |
|
|
99
|
-
| searchConfig | 搜索配置 | object | 否 |
|
|
100
|
-
| userInfoConfig | 用户信息配置 | object | 否 |
|
|
101
|
-
| projectTreeConfig | 项目树配置 | object | 否 |
|
|
356
|
+
### 3. **事件**
|
|
102
357
|
|
|
103
358
|
| 事件 | 说明 | 回调参数 |
|
|
104
359
|
| ----------------- | --------------------------- | ------------------------------- |
|
|
@@ -111,29 +366,17 @@ createCeNav('das-ce-nav')
|
|
|
111
366
|
| userCommandHandle | 用户信息-操作项 | function(value:any) |
|
|
112
367
|
| changeTreeHandle | 项目树-是否确定切换选中项目 | function(status:bool,value:any) |
|
|
113
368
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
### 3. das-ce-menu 侧边菜单栏组件
|
|
117
|
-
|
|
118
|
-
- 支持菜单折叠、选中、动态数据等功能。
|
|
119
|
-
- 通过 `createCeMenu('das-ce-menu')` 注册。
|
|
120
|
-
- 主要属性:
|
|
121
|
-
- `modelValue`:当前选中菜单 key。
|
|
122
|
-
- `data`:菜单数据数组。
|
|
123
|
-
- `collapse`:菜单栏初始折叠状态。
|
|
124
|
-
- 主要事件:
|
|
125
|
-
- `change`:选中项改变时触发。
|
|
126
|
-
- `collapse-change`:菜单折叠状态改变时触发。
|
|
127
|
-
- 主要方法:
|
|
128
|
-
- `changeCollapse`:切换菜单折叠状态。
|
|
369
|
+
## das-ce-menu 使用方法
|
|
129
370
|
|
|
130
|
-
|
|
371
|
+
1. **引入 `das-ce-menu` 组件并注册**。
|
|
131
372
|
|
|
132
373
|
```js
|
|
133
374
|
import { createCeMenu } from '@das-fed/web-components'
|
|
134
375
|
createCeMenu('das-ce-menu')
|
|
135
376
|
```
|
|
136
377
|
|
|
378
|
+
2. **使用**。
|
|
379
|
+
|
|
137
380
|
```html
|
|
138
381
|
<das-ce-menu
|
|
139
382
|
:data="menuData"
|
|
@@ -145,23 +388,23 @@ createCeMenu('das-ce-menu')
|
|
|
145
388
|
></das-ce-menu>
|
|
146
389
|
```
|
|
147
390
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
## 三、组件属性与类型定义
|
|
151
|
-
|
|
152
|
-
详细属性、类型定义和事件请参考源码及注释。
|
|
153
|
-
|
|
154
|
-
---
|
|
391
|
+
3. **属性**
|
|
155
392
|
|
|
156
|
-
|
|
393
|
+
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
394
|
+
| ---------- | ------------------ | ------------- | ------ | -------- |
|
|
395
|
+
| modelValue | 当前选中菜单 | string/number | - | 是 |
|
|
396
|
+
| data | 导航栏配置 | array | [] | 是 |
|
|
397
|
+
| collapse | 菜单栏初始折叠状态 | boolean | false | 否 |
|
|
157
398
|
|
|
158
|
-
|
|
159
|
-
- 组件事件均通过 `customEvent.detail` 获取返回值。
|
|
160
|
-
- 支持自定义插槽、动态数据、复杂交互。
|
|
161
|
-
- 推荐结合 DAS Web 主应用统一布局和微前端架构使用。
|
|
399
|
+
4. **事件**
|
|
162
400
|
|
|
163
|
-
|
|
401
|
+
| 事件 | 描述 | 回调参数 |
|
|
402
|
+
| --------------- | ---------------- | ------------------------------------------- |
|
|
403
|
+
| change | 选中项改变触发 | function(value: string/number, option: any) |
|
|
404
|
+
| collapse-change | 折叠状态改变触发 | function(value:boolean) |
|
|
164
405
|
|
|
165
|
-
|
|
406
|
+
5. **方法**
|
|
166
407
|
|
|
167
|
-
|
|
408
|
+
| 方法 | 描述 | 参数 |
|
|
409
|
+
| -------------- | ------------ | ------------------------------ |
|
|
410
|
+
| changeCollapse | 切换折叠状态 | 接收一个布尔类型参数:折叠状态 |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as t, c as o, o as a, w as e, m as r, n as i, u as n, p as c } from "./index-
|
|
1
|
+
import { d as t, c as o, o as a, w as e, m as r, n as i, u as n, p as c } from "./index-BmQpLk5K.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1680860877984" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11230" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M711.466667 464.512c2.816 2.56 5.376 5.504 7.68 8.661333 19.029333 26.197333 15.573333 64.853333-7.68 86.314667L381.44 863.872a50.773333 50.773333 0 0 1-34.432 13.824c-30.037333 0-54.4-27.434667-54.4-61.312V207.616c0-14.165333 4.352-27.861333 12.288-38.826667 19.029333-26.24 53.333333-30.08 76.544-8.661333l330.069333 304.384z" p-id="11231"></path></svg>', h = /* @__PURE__ */ t({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(w) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, c as o, o as a, w as e, m as i, n as l, u as t, p as r } from "./index-
|
|
1
|
+
import { d as n, c as o, o as a, w as e, m as i, n as l, u as t, p as r } from "./index-BmQpLk5K.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1680860959118" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11369" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 170.666667m85.333333 0l0 0q85.333333 0 85.333334 85.333333l0 512q0 85.333333-85.333334 85.333333l0 0q-85.333333 0-85.333333-85.333333l0-512q0-85.333333 85.333333-85.333333Z" p-id="11370"></path><path d="M597.333333 170.666667m85.333334 0l0 0q85.333333 0 85.333333 85.333333l0 512q0 85.333333-85.333333 85.333333l0 0q-85.333333 0-85.333334-85.333333l0-512q0-85.333333 85.333334-85.333333Z" p-id="11371"></path></svg>', h = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(c) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as C, c as t, o as e, w as L, m as o, n as s, u as r, p as i } from "./index-
|
|
1
|
+
import { d as C, c as t, o as e, w as L, m as o, n as s, u as r, p as i } from "./index-BmQpLk5K.js";
|
|
2
2
|
const a = `<?xml version="1.0" encoding="UTF-8"?>\r
|
|
3
3
|
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
|
|
4
4
|
<title>图标/通用操作/全屏备份 4</title>\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as t, c as a, o, w as r, m as e, n as i, u as s, p } from "./index-
|
|
1
|
+
import { d as t, c as a, o, w as r, m as e, n as i, u as s, p } from "./index-BmQpLk5K.js";
|
|
2
2
|
const c = `<?xml version="1.0" standalone="no"?>\r
|
|
3
3
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1716346578169"\r
|
|
4
4
|
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11033"\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, c as t, o as e, w as o, m as a, n as r, u as c, p as i } from "./index-
|
|
1
|
+
import { d as n, c as t, o as e, w as o, m as a, n as r, u as c, p as i } from "./index-BmQpLk5K.js";
|
|
2
2
|
const h = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1669969511811" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3001" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M96 384c19.2 0 32-12.8 32-32V128h224c19.2 0 32-12.8 32-32S371.2 64 352 64h-256c-19.2 0-32 12.8-32 32v256c0 19.2 12.8 32 32 32zM416 576h-256c-19.2 0-32 12.8-32 32s12.8 32 32 32h179.2l-262.4 262.4c-12.8 12.8-12.8 32 0 44.8 12.8 12.8 32 12.8 44.8 0L384 684.8v179.2c0 19.2 12.8 32 32 32s32-12.8 32-32v-256c0-19.2-12.8-32-32-32zM896 416c0-19.2-12.8-32-32-32h-179.2l262.4-262.4c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L640 339.2V160c0-19.2-12.8-32-32-32s-32 12.8-32 32v256c0 19.2 12.8 32 32 32h256c19.2 0 32-12.8 32-32zM928 640c-19.2 0-32 12.8-32 32V896h-224c-19.2 0-32 12.8-32 32s12.8 32 32 32h256c19.2 0 32-12.8 32-32v-256c0-19.2-12.8-32-32-32z" p-id="3002"></path></svg>', d = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(l) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as s, s as z, f as C, e as c, d as U, g as A, h as O, i as R, o as $, j as m, w as v, b as x, u as n, k as j, l as V, a as k, t as T, D as M, _ as P } from "./index-
|
|
1
|
+
import { r as s, s as z, f as C, e as c, d as U, g as A, h as O, i as R, o as $, j as m, w as v, b as x, u as n, k as j, l as V, a as k, t as T, D as M, _ as P } from "./index-BmQpLk5K.js";
|
|
2
2
|
const q = (p) => (s(null), { saveKnow: async (o) => {
|
|
3
3
|
var i;
|
|
4
4
|
console.log("saveKnow", o);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as o, c as n, o as e, w as t, m as r, n as c, u as a, p as i } from "./index-
|
|
1
|
+
import { d as o, c as n, o as e, w as t, m as r, n as c, u as a, p as i } from "./index-BmQpLk5K.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512 32A352 352 0 0 0 160 384c0 130.112 62.976 262.336 167.168 390.848a1256.768 1256.768 0 0 0 138.496 144.96l23.872 20.48 2.496 2.048a32 32 0 0 0 39.936 0l14.72-12.288a1256.768 1256.768 0 0 0 150.208-155.2C800.96 646.336 864 514.112 864 384A352 352 0 0 0 512 32z m0 64A288 288 0 0 1 800 384c0 112.576-57.024 232.32-152.832 350.528a1193.408 1193.408 0 0 1-107.136 115.2l-17.408 16.192-10.624 9.408-19.008-17.152a1193.408 1193.408 0 0 1-116.16-123.712C281.024 616.32 224 496.64 224 384A288 288 0 0 1 512 96zM512 224a160 160 0 1 0 0 320 160 160 0 0 0 0-320z m0 64a96 96 0 1 1 0 192 96 96 0 0 1 0-192z" /></svg>', d = /* @__PURE__ */ o({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(l) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as t, c as e, o, w as s, m as a, n as i, u as r, p as l } from "./index-
|
|
1
|
+
import { d as t, c as e, o, w as s, m as a, n as i, u as r, p as l } from "./index-BmQpLk5K.js";
|
|
2
2
|
const d = `<?xml version="1.0" encoding="UTF-8"?>\r
|
|
3
3
|
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
|
|
4
4
|
<title>解锁</title>\r
|