wui-components-v2 1.2.84 → 1.2.85
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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineEmits, defineOptions, defineProps } from 'vue'
|
|
3
|
+
import type { FilterInTabPageItem } from '../../type'
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'FilterInTabPage',
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
/** 同一 blockId 下的 tab 项(由调用方按 order 排序后传入) */
|
|
11
|
+
tabs: FilterInTabPageItem[]
|
|
12
|
+
/** 当前列表页的 sourceId,用于高亮激活 tab */
|
|
13
|
+
activeId: string
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits<{
|
|
17
|
+
(e: 'change', item: FilterInTabPageItem): void
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
// click事件:wd-tab 回调携带 name(即 item.id),换算成 tab 项后抛给父级处理跳转
|
|
21
|
+
function click(event: { name: string }) {
|
|
22
|
+
const item = props.tabs.find(i => i.id === event.name)
|
|
23
|
+
if (item) {
|
|
24
|
+
emit('change', item)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<wd-tabs :model-value="activeId" animated slidable="always" @click="click">
|
|
31
|
+
<block v-for="item in tabs" :key="item.id">
|
|
32
|
+
<wd-tab :title="item.title" :name="item.id" />
|
|
33
|
+
</block>
|
|
34
|
+
</wd-tabs>
|
|
35
|
+
</template>
|
package/package.json
CHANGED
package/type.ts
CHANGED
|
@@ -22,6 +22,25 @@ export type Comparator =
|
|
|
22
22
|
// tab字段配置
|
|
23
23
|
export interface Split2TabCriterias extends Fields {}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* fastMenu.FilterInTabPage 项:同组列表页 tab(如声音/振动/温度报警)。
|
|
27
|
+
* 同组项共享同一个 blockId,order 决定排列顺序,id 即对应列表页的 sourceId。
|
|
28
|
+
*/
|
|
29
|
+
export interface FilterInTabPageItem {
|
|
30
|
+
id: string
|
|
31
|
+
blockId: string
|
|
32
|
+
title: string
|
|
33
|
+
pageType: string
|
|
34
|
+
order: string
|
|
35
|
+
themeColor?: string
|
|
36
|
+
icon?: string
|
|
37
|
+
appIcon?: string
|
|
38
|
+
tip?: string | null
|
|
39
|
+
disabled?: boolean
|
|
40
|
+
defaultCriteriaValue?: { [key: string]: any }
|
|
41
|
+
[key: string]: any
|
|
42
|
+
}
|
|
43
|
+
|
|
25
44
|
// 列表字段配置
|
|
26
45
|
export interface Columns {
|
|
27
46
|
controlType: string
|