fix: 【设备管理-运行状态】修复界面卡死无法点击
This commit is contained in:
parent
5b76b078d2
commit
10f77f296b
|
@ -86,45 +86,61 @@ const _getEventList = (_params: any) =>
|
||||||
getEventList(instanceStore.current.id || '', events.data.id || '', _params);
|
getEventList(instanceStore.current.id || '', events.data.id || '', _params);
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
columns.value = [...defaultColumns];
|
columns.value = [...defaultColumns];
|
||||||
if (events.data?.valueType?.type === 'object') {
|
if (events.data?.valueType?.type === 'object') {
|
||||||
const eventProperties = cloneDeep(events.data.valueType?.properties || [])
|
const eventProperties = cloneDeep(events.data.valueType?.properties || [])
|
||||||
eventProperties.reverse().map((i: any) => {
|
eventProperties.reverse().map((i: any) => {
|
||||||
if (i.valueType?.type === 'object') {
|
if (['object', 'array'].includes(i.valueType?.type)) {
|
||||||
objectKey.value.push({
|
objectKey.value.push({
|
||||||
key:i.id,
|
key: i.id,
|
||||||
dataIndex: `${i.id}_format`
|
dataIndex: `${i.id}_format`
|
||||||
});
|
|
||||||
columns.value.splice(0, 0, {
|
|
||||||
key: i.id,
|
|
||||||
title: i.name,
|
|
||||||
dataIndex: `${i.id}_format`,
|
|
||||||
search: {
|
|
||||||
type: i?.valueType?.type || 'string',
|
|
||||||
rename: i.id,
|
|
||||||
},
|
|
||||||
scopedSlots: true,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
columns.value.splice(0, 0, {
|
|
||||||
key: i.id,
|
|
||||||
title: i.name,
|
|
||||||
dataIndex: `${i.id}_format`,
|
|
||||||
search: {
|
|
||||||
type: i?.valueType?.type || 'string',
|
|
||||||
rename: i.id,
|
|
||||||
},
|
|
||||||
ellipsis: true,
|
|
||||||
scopedSlots: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
columns.value.splice(0, 0, {
|
columns.value.splice(0, 0, {
|
||||||
title: '数据',
|
key: i.id,
|
||||||
dataIndex: 'value',
|
title: i.name,
|
||||||
|
dataIndex: `${i.id}_format`,
|
||||||
|
search: {
|
||||||
|
type: 'string',
|
||||||
|
rename: i.id,
|
||||||
|
},
|
||||||
|
scopedSlots: true,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
const arr = i?.valueType?.type === 'boolean' ? [
|
||||||
|
{
|
||||||
|
label: i?.valueType.falseText,
|
||||||
|
value: i?.valueType.falseValue
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: i?.valueType.trueText,
|
||||||
|
value: i?.valueType.trueValue
|
||||||
|
},
|
||||||
|
] : (i?.valueType?.elements || []).map(item => {
|
||||||
|
return {
|
||||||
|
label: item.text,
|
||||||
|
value: item.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
columns.value.splice(0, 0, {
|
||||||
|
key: i.id,
|
||||||
|
title: i.name,
|
||||||
|
dataIndex: `${i.id}_format`,
|
||||||
|
search: {
|
||||||
|
type: componentsType?.[i?.valueType?.type] || 'string',
|
||||||
|
rename: i.id,
|
||||||
|
options: arr
|
||||||
|
},
|
||||||
|
ellipsis: true,
|
||||||
|
scopedSlots: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
columns.value.splice(0, 0, {
|
||||||
|
title: '数据',
|
||||||
|
dataIndex: 'value',
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSearch = (_params: any) => {
|
const handleSearch = (_params: any) => {
|
||||||
|
|
Loading…
Reference in New Issue