Commit f1042920 authored by 皮倩雯's avatar 皮倩雯

fix: '物联网接口参数修改'

parent 92f71fbd
Pipeline #69482 passed with stages
...@@ -73,11 +73,6 @@ const ServiceLog = () => { ...@@ -73,11 +73,6 @@ const ServiceLog = () => {
const startYear = new Date(allTime[0]).getYear(); const startYear = new Date(allTime[0]).getYear();
const endYear = new Date(allTime[1]).getYear(); const endYear = new Date(allTime[1]).getYear();
if (minuteInterval <= 0) { if (minuteInterval <= 0) {
console.log(start);
console.log(end);
console.log(allTime[0]);
console.log(allTime[1]);
console.log(minuteInterval);
notification.error({ notification.error({
message: '时间设置有误', message: '时间设置有误',
description: '起始时间应该早于结束时间', description: '起始时间应该早于结束时间',
...@@ -469,7 +464,6 @@ const ServiceLog = () => { ...@@ -469,7 +464,6 @@ const ServiceLog = () => {
setEndTime(time); setEndTime(time);
}; };
const changeTime = time => { const changeTime = time => {
console.log(time);
setAllTime(time); setAllTime(time);
}; };
// 近1/6/12/24小时,同时设置对应的时间间隔 // 近1/6/12/24小时,同时设置对应的时间间隔
......
...@@ -115,19 +115,21 @@ const IotConfig = props => { ...@@ -115,19 +115,21 @@ const IotConfig = props => {
setCurrentDataBase(res.data); setCurrentDataBase(res.data);
// 数据库是否已添加 // 数据库是否已添加
setLoading(true); setLoading(true);
CheckIsServiceAdd({ ip: res.data.ip }) CheckIsServiceAdd()
.then(resdata1 => { .then(resdata1 => {
setLoading(false); setLoading(false);
if (resdata1.code === 0) { if (resdata1.code === 0) {
setShow3('inline-block'); if (resdata1.data === true) {
setShow4('none'); setShow3('inline-block');
getStatus(res.data.ip, res.data.dbName); setShow4('none');
} else { getStatus(res.data.ip, res.data.dbName);
setDbStatus(resdata1.msg); } else {
setBuStatus('添加'); setDbStatus(resdata1.msg);
setSwitchStatus(true); setBuStatus('添加');
setShow3('none'); setSwitchStatus(true);
setShow4('inline-block'); setShow3('none');
setShow4('inline-block');
}
} }
}) })
.catch(err => { .catch(err => {
...@@ -140,7 +142,7 @@ const IotConfig = props => { ...@@ -140,7 +142,7 @@ const IotConfig = props => {
const getStatus = (x, y) => { const getStatus = (x, y) => {
// 查询是否禁用 // 查询是否禁用
GetServiceInfo({ ip: x }) GetServiceInfo()
.then(resdata => { .then(resdata => {
if (resdata.code === 0) { if (resdata.code === 0) {
setDbStatus(resdata.data.statusText); setDbStatus(resdata.data.statusText);
...@@ -341,9 +343,7 @@ const IotConfig = props => { ...@@ -341,9 +343,7 @@ const IotConfig = props => {
} else { } else {
// 数据库未添加 // 数据库未添加
setLoading(true); setLoading(true);
AddDB({ AddDB().then(res => {
ip: currentDataBase.ip,
}).then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
setShow3('inline-block'); setShow3('inline-block');
...@@ -403,9 +403,7 @@ const IotConfig = props => { ...@@ -403,9 +403,7 @@ const IotConfig = props => {
if (checked) { if (checked) {
setSwitchStatus(true); setSwitchStatus(true);
setLoading(true); setLoading(true);
DepositServiceEnable({ DepositServiceEnable().then(res => {
ip: currentDataBase.ip,
}).then(res => {
setLoading(false); setLoading(false);
getStatus(currentDataBase.ip, currentDataBase.dbName); getStatus(currentDataBase.ip, currentDataBase.dbName);
if (res.code === 0) { if (res.code === 0) {
...@@ -417,9 +415,7 @@ const IotConfig = props => { ...@@ -417,9 +415,7 @@ const IotConfig = props => {
}); });
} else { } else {
setLoading(true); setLoading(true);
DepositServiceDisable({ DepositServiceDisable().then(res => {
ip: currentDataBase.ip,
}).then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
setDbStatus('已禁用'); setDbStatus('已禁用');
......
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