Commit fe9c373d authored by 涂茜's avatar 涂茜

Merge branch 'fix/bug' into 'dev'

fix: bug See merge request !47
parents 68223663 34fb99e6
Pipeline #28729 passed with stages
in 5 minutes 5 seconds
...@@ -12,7 +12,7 @@ const Demo = () => { ...@@ -12,7 +12,7 @@ const Demo = () => {
const fetchData = (params = {}) => { const fetchData = (params = {}) => {
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
request(`${baseUrl}/Publish/Monitor/Device/DeviceTree`, { request(`${baseUrl}/Publish/GCK/Device/DeviceTree`, {
method: 'post', method: 'post',
data: { data: {
pageIndex: 1, pageIndex: 1,
...@@ -29,7 +29,7 @@ const Demo = () => { ...@@ -29,7 +29,7 @@ const Demo = () => {
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
const data = response.data const data = response.data
? response.data.list && response.data.list.length > 0 ? response.data.list && response.data.list.length > 0
? response.data.list[0].DeviceList ? response.data.list[0].deviceList
: [] : []
: []; : [];
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
...@@ -41,9 +41,9 @@ const Demo = () => { ...@@ -41,9 +41,9 @@ const Demo = () => {
// eslint-disable-next-line array-callback-return // eslint-disable-next-line array-callback-return
data.map((item) => { data.map((item) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
item.title = item.DeviceName; item.title = item.deviceName;
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
item.key = item.StationID; item.key = item.stationID;
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
item.children = handleData(item.children); item.children = handleData(item.children);
}); });
......
...@@ -20,6 +20,20 @@ ...@@ -20,6 +20,20 @@
white-space: nowrap; white-space: nowrap;
} }
.ant-tree-treenode {
width: 100%;
}
.ant-tree-switcher-noop {
width: 14px;
}
.ant-tree-node-content-wrapper {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
}
&-content { &-content {
flex: 1; flex: 1;
overflow-y: scroll; overflow-y: scroll;
......
...@@ -20,25 +20,25 @@ const Demo = () => { ...@@ -20,25 +20,25 @@ const Demo = () => {
}, []); }, []);
const fetchData = (params = {}) => { const fetchData = (params = {}) => {
request(baseUrl + '/Publish/Monitor/Device/SensorsDataForStation', { request(baseUrl + '/PandaCore/Monitor/Device/SensorsDataForStation', {
method: 'post', method: 'post',
data: params, data: params,
}).then((res) => { }).then((res) => {
let resData = res.data; let resData = res.data;
let columnsData = resData.map((item, index) => { let columnsData = resData.map((item, index) => {
return { return {
title: `${item.EquipmentName}-${item.sensorName}${ title: `${item.equipmentName}-${item.sensorName}${
item.unit ? '(' + item.unit + ')' : '' item.unit ? '(' + item.unit + ')' : ''
}`, }`,
dataIndex: `value${index + 1}`, dataIndex: `value${index + 1}`,
key: `value${index + 1}`, key: `value${index + 1}`,
}; };
}); });
let tableData = resData[0].dataModel.map((item, index) => ({ key: index, time: item.PT })); let tableData = resData[0].dataModel.map((item, index) => ({ key: index, time: item.pt }));
tableData.forEach((item, i) => { tableData.forEach((item, i) => {
resData.forEach((child, index) => { resData.forEach((child, index) => {
child.dataModel.forEach((value, j) => { child.dataModel.forEach((value, j) => {
if (i === j) item[`value${index + 1}`] = value.PV; if (i === j) item[`value${index + 1}`] = value.pv;
}); });
}); });
}); });
...@@ -54,10 +54,10 @@ const Demo = () => { ...@@ -54,10 +54,10 @@ const Demo = () => {
resData.forEach((item) => { resData.forEach((item) => {
let data = []; let data = [];
item.dataModel.forEach((child) => { item.dataModel.forEach((child) => {
data.push([moment(child.PT).valueOf(), child.PV]); data.push([moment(child.pt).valueOf(), child.pv]);
}); });
let obj = { let obj = {
name: item.EquipmentName + item.sensorName, name: item.equipmentName + item.sensorName,
sensorName: item.sensorName, sensorName: item.sensorName,
decimalPoint: item.decimalPoint, decimalPoint: item.decimalPoint,
unit: item.unit, unit: item.unit,
......
...@@ -9,7 +9,7 @@ const Demo = () => { ...@@ -9,7 +9,7 @@ const Demo = () => {
const [selectData, setSelectData] = useState([]); const [selectData, setSelectData] = useState([]);
const fetchData = () => { const fetchData = () => {
request(baseUrl + '/Publish/Monitor/Device/GetQuotaList', { request(baseUrl + '/Publish/GCK/Device/GetQuotaList', {
method: 'get', method: 'get',
params: { params: {
accountName: '二供泵房', accountName: '二供泵房',
......
...@@ -10,7 +10,7 @@ const Demo = () => { ...@@ -10,7 +10,7 @@ const Demo = () => {
const [updateTime, setUpdateTime] = useState(''); const [updateTime, setUpdateTime] = useState('');
const GetPointAddressEntry = (params = {}) => { const GetPointAddressEntry = (params = {}) => {
return request(baseUrl + '/Publish/Monitor/PointAddress/GetPointAddressEntry', { return request(baseUrl + '/Publish/GCK/PointAddress/GetPointAddressEntry', {
method: 'get', method: 'get',
params: { params: {
versionID: 4, versionID: 4,
...@@ -19,14 +19,14 @@ const Demo = () => { ...@@ -19,14 +19,14 @@ const Demo = () => {
}; };
const GetSensorType = (params = {}) => { const GetSensorType = (params = {}) => {
return request(baseUrl + '/Publish/Monitor/Scada/GetSensorType', { return request(baseUrl + '/Publish/GCK/Sensor/GetSensorType', {
method: 'get', method: 'get',
params: {}, params: {},
}); });
}; };
const GetDeviceRealInfo = (params = {}) => { const GetDeviceRealInfo = (params = {}) => {
return request(baseUrl + '/Publish/Monitor/Device/DeviceRealInfo', { return request(baseUrl + '/Publish/GCK/Device/DeviceRealInfo', {
method: 'post', method: 'post',
data: { data: {
userID: '1', userID: '1',
...@@ -44,33 +44,33 @@ const Demo = () => { ...@@ -44,33 +44,33 @@ const Demo = () => {
let data2 = await GetSensorType(); let data2 = await GetSensorType();
let data3 = await GetDeviceRealInfo(); let data3 = await GetDeviceRealInfo();
setUpdateTime(data3.data.list[0].PT); setUpdateTime(data3.data.list[0].PT);
setGuid(data3.data.list[0].Child[0].GUID); setGuid(data3.data.list[0].child[0].guid);
handleData(data1.data, data2.data, data3.data); handleData(data1.data, data2.data, data3.data);
}; };
const handleData = (data1 = [], data2 = [], data3 = []) => { const handleData = (data1 = [], data2 = [], data3 = []) => {
let newData = data1.map((item, index) => { let newData = data1.map((item, index) => {
return { return {
id: item.ID, id: item.id,
key: item.ID, key: item.id,
index: index + 1, index: index + 1,
name: item.Name, name: item.Name,
value: 0, value: 0,
unit: '--', unit: '--',
type: '--', type: '--',
time: data3.list[0].PT, time: data3.list[0].pt,
...item, ...item,
}; };
}); });
newData.forEach((item) => { newData.forEach((item) => {
let curData1 = data2.filter((child) => child.ID == item.SensorTypeID); let curData1 = data2.filter((child) => child.id == item.sensorTypeID);
let curData2 = data3.list[0].DataList.filter((child) => child.PAID == item.ID); let curData2 = data3.list[0].dataList.filter((child) => child.paid == item.id);
if (curData1.length) { if (curData1.length) {
item.unit = curData1[0].Unit || '--'; item.unit = curData1[0].unit || '--';
item.type = curData1[0].Name || '--'; item.type = curData1[0].name || '--';
} }
if (curData2.length) { if (curData2.length) {
item.value = curData2[0].PV || '--'; item.value = curData2[0].pv || '--';
} }
}); });
setData(newData); setData(newData);
......
...@@ -305,7 +305,7 @@ const QuotaSelect = ({ ...@@ -305,7 +305,7 @@ const QuotaSelect = ({
return ( return (
<div className={classNames(prefixCls)}> <div className={classNames(prefixCls)}>
<div className={classNames(`${prefixCls}-btn-wrap`)}> <div className={classNames(`${prefixCls}-btn-wrap`)}>
{deviceList.length && {!!deviceList.length &&
deviceList.map((item, index) => ( deviceList.map((item, index) => (
<Button <Button
key={index} key={index}
......
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