diff --git a/src/views/iot/deviceParamAnalysis/index.vue b/src/views/iot/deviceParamAnalysis/index.vue index fdd2326a..2e3b6237 100644 --- a/src/views/iot/deviceParamAnalysis/index.vue +++ b/src/views/iot/deviceParamAnalysis/index.vue @@ -2,13 +2,19 @@ - +
+ + + + {{ t('DataCollection.DeviceParamAnalysis.refreshButtonText') }} + +
+ > + +
@@ -93,11 +106,13 @@ defineOptions({ name: 'DeviceParamAnalysis' }) const { t } = useI18n() type TreeNodeType = 'device' | 'param' +type TreeNodeTag = 'equipment' type DeviceTreeNode = { id: string label: string type: TreeNodeType + tag?: TreeNodeTag children?: DeviceTreeNode[] orgClass?: string deviceId?: number @@ -203,6 +218,14 @@ const handleKeywordChange = () => { }, 300) } +const handleTreeRefresh = async () => { + if (keywordTimer) { + window.clearTimeout(keywordTimer) + keywordTimer = undefined + } + await loadTree() +} + const toFiniteId = (value: any): number | undefined => { if (typeof value === 'number') return Number.isFinite(value) ? value : undefined if (typeof value === 'string') { @@ -300,6 +323,7 @@ const buildTreeFromApi = (orgs: ApiTreeOrg[]): DeviceTreeNode[] => { id: `equipment-${org.id}-${eq.id}`, label: eq?.name ?? String(eq?.id ?? ''), type: 'device', + tag: 'equipment', deviceId: toFiniteId(eq.id), paramCount: params.length, children: paramNodes.length ? paramNodes : undefined, @@ -695,6 +719,29 @@ onMounted(async () => { gap: 12px; } +.device-param-tree-toolbar { + display: flex; + align-items: center; + gap: 8px; +} + +.device-param-tree-toolbar__input { + flex: 1; + min-width: 0; +} + +.device-param-tree-node { + display: inline-flex; + align-items: center; + gap: 6px; + min-width: 0; +} + +.device-param-tree-node__label { + overflow: hidden; + text-overflow: ellipsis; +} + :deep(.el-tree) { max-height: calc(100vh - 280px); overflow: auto;