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

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

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