Commit 9f4ef61f authored by 涂茜's avatar 涂茜

fix: bug

parent 206e7c16
Pipeline #26336 failed with stages
in 15 seconds
...@@ -79,7 +79,7 @@ const Demo = () => { ...@@ -79,7 +79,7 @@ const Demo = () => {
}; };
return ( return (
<div style={{ width: '300px', height: '400px', border: '1px solid #eee' }}> <div style={{ width: '200px', height: '400px', border: '1px solid #eee' }}>
<PandaDeviceTree <PandaDeviceTree
onSearch={onSearch} onSearch={onSearch}
checkable checkable
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
margin: 6px 0 12px 0; margin: 6px 0 12px 0;
} }
.ant-tree-checkbox {
margin: 4px 2px 0 0;
}
.ant-tree-title {
white-space: nowrap;
}
&-content { &-content {
flex: 1; flex: 1;
overflow-y: scroll; overflow-y: scroll;
......
...@@ -19,6 +19,16 @@ const Demo = () => { ...@@ -19,6 +19,16 @@ const Demo = () => {
.then(function (response) { .then(function (response) {
if (response.code == '0') { if (response.code == '0') {
let curData = response.data; let curData = response.data;
curData.forEach((item) => {
item.decimalBit = item.DecimalBit;
item.deviation = item.Deviation;
item.format = item.Format;
item.isShow = item.IsShow;
item.name = item.Name;
item.style = item.Style;
item.type = item.Type;
item.unit = item.Unit;
});
setQuotaList(curData); setQuotaList(curData);
} }
}) })
......
...@@ -40,8 +40,8 @@ const QuotaSelect = ({ ...@@ -40,8 +40,8 @@ const QuotaSelect = ({
let data = dataSource.map((item) => ({ let data = dataSource.map((item) => ({
...item, ...item,
checked: false, checked: false,
title: item.Name, title: item.name,
key: item.Name, key: item.name,
})); }));
setAllQuotaList(data); setAllQuotaList(data);
} }
...@@ -71,7 +71,7 @@ const QuotaSelect = ({ ...@@ -71,7 +71,7 @@ const QuotaSelect = ({
// 过滤重点指标 // 过滤重点指标
const filterEmphasisQuota = () => { const filterEmphasisQuota = () => {
let newQuotaList = [...allQuotaList]; let newQuotaList = [...allQuotaList];
newQuotaList = newQuotaList.filter((item) => item.IsShow === '1'); newQuotaList = newQuotaList.filter((item) => item.isShow === '1');
setQuotaList(newQuotaList); setQuotaList(newQuotaList);
}; };
...@@ -111,7 +111,7 @@ const QuotaSelect = ({ ...@@ -111,7 +111,7 @@ const QuotaSelect = ({
if (e.target.value !== '') { if (e.target.value !== '') {
let newQuotaList = []; let newQuotaList = [];
quotaList.forEach((item) => { quotaList.forEach((item) => {
if (item.Name.indexOf(e.target.value) > -1) newQuotaList.push(item); if (item.name.indexOf(e.target.value) > -1) newQuotaList.push(item);
}); });
setQuotaList(newQuotaList); setQuotaList(newQuotaList);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment