Browse Source

增加 加载失败错误提示

develop
chenJinxu 11 months ago
parent
commit
491e479af9
2 changed files with 50 additions and 19 deletions
  1. +1
    -1
      src/config/models.js
  2. +49
    -18
      src/views/gps-card-frontend/device-setting/index.vue

+ 1
- 1
src/config/models.js View File

@@ -5,7 +5,7 @@
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description:
*/
export const VERSION_MODEL = '1.0.110F'; //版本号
export const VERSION_MODEL = '1.0.111F'; //版本号
export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/',


+ 49
- 18
src/views/gps-card-frontend/device-setting/index.vue View File

@@ -112,10 +112,22 @@ export default {
message: '数据加载完成',
duration: 2000
});
} else {
this.$toast.clear();
this.$dialog.confirm({
title: '提示',
message: '加载失败,请重新进入或者刷新页面',
showCancelButton: false
})
}
} catch(error){
console.log('error', error);
this.$toast.clear();
this.$dialog.confirm({
title: '提示',
message: '加载失败,请重新进入或者刷新页面',
showCancelButton: false
})
}
},
// 获取b端接口的token
@@ -207,7 +219,7 @@ export default {
this.settingItems[2].text = this.concatTitle('加强省电模式','关闭', '耗电低');
}
}) */
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
APICore.getIotCtlMode(this.imei).then(res => {
let data = res.data.data;
let index = 3;
@@ -223,8 +235,11 @@ export default {
} else {
this.settingItems[findIndex].text = this.concatTitle('加强省电模式','关闭', '耗电低');
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true)
})
},
// 获取设备定位参数
@@ -241,7 +256,7 @@ export default {
this.settingItems[3].text = this.concatTitle('定位监测','关闭', '耗电低');
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getLocationConfig({imei: this.imei}).then(res => {
let data = res.data.data;
let index = 4;
@@ -257,8 +272,10 @@ export default {
} else {
this.settingItems[findIndex].text = this.concatTitle('定位监测','关闭', '耗电低');
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true)
})
},
// 获取免告警水域
@@ -296,7 +313,7 @@ export default {
this.settingItems[4].data = [];
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getDrownConfig({imei: this.imei}).then(res => {
let data = res.data.data;
let index = 5;
@@ -320,8 +337,10 @@ export default {
this.settingItems[findIndex].text = this.concatTitle('危险区域监测','关闭', '耗电低');
this.settingItems[findIndex].data = [];
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},

@@ -367,7 +386,7 @@ export default {
this.settingItems[5].data = [];
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getHealthConfig({imei: this.imei}).then(res => {
let data = res.data.data;
let index = 6;
@@ -409,8 +428,10 @@ export default {
this.settingItems[findIndex].text = this.concatTitle('健康监测','关闭', '耗电低');
this.settingItems[findIndex].data = [];
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},
// 获取血压监测参数设置
@@ -430,7 +451,7 @@ export default {
this.settingItems[6].data = [];
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getBloodPressConfig({imei: this.imei}).then(res => {
let data = res.data.data;
let index = 7;
@@ -449,8 +470,10 @@ export default {
this.settingItems[findIndex].text = this.concatTitle('血压监测','关闭', '耗电低');
this.settingItems[findIndex].data = [];
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},
// 格式化等级
@@ -493,7 +516,7 @@ export default {
this.settingItems[7].data = [];
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getPsychAbilityConfig({imei: this.imei}).then(res => {
let data = res.data.data;
let index = 8;
@@ -516,8 +539,10 @@ export default {
this.settingItems[findIndex].text = this.concatTitle('心理监测', '关闭', '耗电低');
this.settingItems[findIndex].data = [];
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},
// 转换时间格式
@@ -571,7 +596,7 @@ export default {
this.settingItems[8].data = [];
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getNowearConfig({ imei: this.imei }).then(res => {
let data = res.data.data;
let index = 9;
@@ -605,8 +630,10 @@ export default {
this.settingItems[findIndex].text = this.concatTitle('佩戴监测', '关闭', '耗电低');
this.settingItems[findIndex].data = [];
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})

},
@@ -620,7 +647,7 @@ export default {
this.settingItems[9].text = '上报周期(关闭)';
}
}); */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
APICore.getUploadConfig({imei: this.imei}).then(res => {
const data = res.data.data;
let index = 10;
@@ -632,8 +659,10 @@ export default {
} else {
this.settingItems[findIndex].text = '上报周期(关闭)';
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},
// 获取设备状态
@@ -646,7 +675,7 @@ export default {
let reqUrl = `${baseUrl}/iotservice/queryDeviceDetail`;
//本地调试地址
/* let reqUrl = `/api/id/queryDeviceDetail`; */
return new Promise(resolve => {
return new Promise((resolve, reject) => {
axios.post(`${reqUrl}`, reqBody).then(res => {
let data = res.data;
let index = 0;
@@ -659,8 +688,10 @@ export default {
} else {
this.settingItems[findIndex].text = `设备状态(无数据)`;
}
resolve(true)
}).catch(e => {
reject(false)
});
resolve(true);
})
},
// 计算设备状态


Loading…
Cancel
Save