修改测试问题
This commit is contained in:
@@ -19,12 +19,9 @@ export interface LineTreeDecorators {
|
||||
export function createLineTreeDecorators(getPrimaryColor: () => string): LineTreeDecorators {
|
||||
const offlineColor = '#e26257 !important'
|
||||
// const statusColor = (comFlag: number) => (comFlag === 2 ? getPrimaryColor() : offlineColor)
|
||||
const statusColor = (comFlag: number) => (comFlag === 2 ? "#2ab914" : offlineColor)
|
||||
const statusColor = (comFlag: number) => (comFlag === 2 ? '#2ab914' : offlineColor)
|
||||
|
||||
const applyMeta = (
|
||||
node: any,
|
||||
meta: { icon: string; color?: string; level?: number; disabled?: boolean }
|
||||
) => {
|
||||
const applyMeta = (node: any, meta: { icon: string; color?: string; level?: number; disabled?: boolean }) => {
|
||||
node.icon = meta.icon
|
||||
if (meta.color !== undefined) node.color = meta.color
|
||||
if (meta.level !== undefined) node.level = meta.level
|
||||
@@ -88,11 +85,10 @@ export function decorateLineTree(
|
||||
applyMeta(leaf, {
|
||||
icon: 'local-监测点',
|
||||
color: statusColor(leaf.comFlag),
|
||||
|
||||
|
||||
...LINE_LEAF_META
|
||||
})
|
||||
leaf.pname=item.name,
|
||||
leaves.engineering.push(leaf)
|
||||
;(leaf.pname = item.name), leaves.engineering.push(leaf)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -115,27 +111,28 @@ export function decorateLineTree(
|
||||
applyMeta(l4, {
|
||||
icon: 'local-监测点',
|
||||
color: statusColor(l4.comFlag),
|
||||
|
||||
|
||||
...LINE_LEAF_META
|
||||
})
|
||||
l4.pname=item.name,
|
||||
leaves.govern.push(l4)
|
||||
;(l4.pname = item.name), (l4.devConType = l3.devConType), leaves.govern.push(l4)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
} else if (item.name === '便携式设备') {
|
||||
item.pname = item.name
|
||||
item.children?.forEach((l1: any) => {
|
||||
|
||||
applyMeta(l1, { icon: 'el-icon-Platform', color: statusColor(l1.comFlag) })
|
||||
l1.pname = item.name
|
||||
l1.children?.forEach((l2: any) => {
|
||||
applyMeta(l2, {
|
||||
icon: 'local-监测点',
|
||||
color: statusColor(l2.comFlag),
|
||||
|
||||
|
||||
...LINE_LEAF_META
|
||||
})
|
||||
l2.pname=item.name,
|
||||
leaves.portable.push(l2)
|
||||
;(l2.pname = item.name), (l2.devConType = l1.devConType), leaves.portable.push(l2)
|
||||
})
|
||||
})
|
||||
} else if (item.name === '监测设备') {
|
||||
@@ -154,11 +151,10 @@ export function decorateLineTree(
|
||||
applyMeta(l4, {
|
||||
icon: 'local-监测点',
|
||||
color: statusColor(l4.comFlag),
|
||||
|
||||
|
||||
...LINE_LEAF_META
|
||||
})
|
||||
l4.pname=item.name,
|
||||
leaves.monitor.push(l4)
|
||||
;(l4.pname = item.name), (l4.devConType = l3.devConType), leaves.monitor.push(l4)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user