优化监控中心前台样式
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
</div>
|
||||
<a-tree-select
|
||||
ref="select"
|
||||
placeholder="请选择设备类型"
|
||||
v-model:value="value"
|
||||
style="width: 100%"
|
||||
:tree-line="treeLine && { showLeafIcon }"
|
||||
@@ -18,6 +19,7 @@
|
||||
v-model:expandedKeys="expandedKeys"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
v-model:checkedKeys="checkedKeys"
|
||||
:show-line="{ showLeafIcon: false }"
|
||||
checkable
|
||||
:height="560"
|
||||
style="width: 100%; overflow-y: auto; margin-bottom: 10px; margin-top: 10px"
|
||||
@@ -124,23 +126,24 @@
|
||||
http.post(device.queryDeviceTree, { orgId: orgId.value }).then((res) => {
|
||||
treeData1.value = formatTreeData(res.data);
|
||||
|
||||
if (treeData1.value && treeData1.value.length > 0) {
|
||||
if (treeData1.value[0].children) {
|
||||
value.value = treeData1.value[0].children[0].value;
|
||||
changeDeviceType(treeData1.value[0].children[0].value, [
|
||||
treeData1.value[0].children[0].title,
|
||||
]);
|
||||
} else {
|
||||
value.value = treeData1.value[0].value;
|
||||
changeDeviceType(treeData1.value[0].value, [treeData1.value[0].title]);
|
||||
}
|
||||
}
|
||||
// if (treeData1.value && treeData1.value.length > 0) {
|
||||
// if (treeData1.value[0].children) {
|
||||
// value.value = treeData1.value[0].children[0].value;
|
||||
// changeDeviceType(treeData1.value[0].children[0].value, [
|
||||
// treeData1.value[0].children[0].title,
|
||||
// ]);
|
||||
// } else {
|
||||
// value.value = treeData1.value[0].value;
|
||||
// changeDeviceType(treeData1.value[0].value, [treeData1.value[0].title]);
|
||||
// }
|
||||
// }
|
||||
});
|
||||
|
||||
const formatTreeData = (data: any) => {
|
||||
return data.map((item: any) => ({
|
||||
title: item.code + '.' + item.deviceType,
|
||||
value: item.code,
|
||||
disabled: item.children.length != 0 ? true : false,
|
||||
children: item.children ? formatTreeData(item.children) : [],
|
||||
}));
|
||||
};
|
||||
|
Reference in New Issue
Block a user