|
@@ -1,6 +1,9 @@
|
|
|
import axios from 'axios';
|
|
|
+import { config } from '../../config';
|
|
|
|
|
|
export default class BackgroundData {
|
|
|
+ /* 当前登录用户 */
|
|
|
+ LoginUser;
|
|
|
/* 标题栏数据 */
|
|
|
TopPoint = [
|
|
|
{
|
|
@@ -113,7 +116,7 @@ export default class BackgroundData {
|
|
|
for (var v in this.TopPoint) {
|
|
|
val += this.TopPoint[v].pointTag + ',';
|
|
|
}
|
|
|
- axios.get(`http://192.168.10.18:8011/ts/latest?keys=${val}`)
|
|
|
+ axios.get(`http://${config.adapterUrl}/ts/latest?keys=${val}`)
|
|
|
.then(this.onTPMessage)
|
|
|
.catch(err =>
|
|
|
console.log(err)
|
|
@@ -126,7 +129,7 @@ export default class BackgroundData {
|
|
|
for (var v in this.Recommends) {
|
|
|
val += v + ',';
|
|
|
}
|
|
|
- axios.get(`http://192.168.10.18:8011/ts/latest?keys=${val}`)
|
|
|
+ axios.get(`http://${config.adapterUrl}/ts/latest?keys=${val}`)
|
|
|
.then(this.onRDMessage)
|
|
|
.catch(err =>
|
|
|
console.log(err)
|
|
@@ -141,19 +144,19 @@ export default class BackgroundData {
|
|
|
var tm = enddt.getTime();
|
|
|
enddt = new Date(tm + 900000);
|
|
|
var startdt = new Date(tm - 86400000);
|
|
|
- axios.get(`http://192.168.10.18:8075/alarm/snap/page?pagenum=1&pagesize=500&category1=custom&rank=4&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
+ axios.get(`http://${config.shardingUrl}/alarm/snap/page?pagenum=1&pagesize=500&category1=custom&rank=4&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
.then(this.onHiddenProblemsMessage)
|
|
|
.catch(err =>
|
|
|
console.log(err)
|
|
|
);
|
|
|
// 2、读取一天内所有的open的windturbine报警,以故障结尾的报警填充到故障,其他的填充到缺陷
|
|
|
- axios.get(`http://192.168.10.18:8075/alarm/snap/page?pagenum=1&pagesize=500&category1=windturbine&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
+ axios.get(`http://${config.shardingUrl}/alarm/snap/page?pagenum=1&pagesize=500&category1=windturbine&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
.then(this.onDefectsMessage)
|
|
|
.catch(err =>
|
|
|
console.log(err)
|
|
|
);
|
|
|
// 3、读取一天内所有open的升压站(SYZ)报警,包含关键字“跳闸”,“开关”,“刀闸”,“断路器”字符的报警信息填充到事故列表
|
|
|
- axios.get(`http://192.168.10.18:8075/alarm/snap/page?pagenum=1&pagesize=500&category1=SYZ&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
+ axios.get(`http://${config.shardingUrl}/alarm/snap/page?pagenum=1&pagesize=500&category1=SYZ&isopened=1&starttime=${this.formatDate(startdt)}&endtime=${this.formatDate(enddt)}`)
|
|
|
.then(this.onAccidentsMessage)
|
|
|
.catch(err =>
|
|
|
console.log(err)
|
|
@@ -259,6 +262,12 @@ export default class BackgroundData {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ login(uname,psd,action){
|
|
|
+ axios.get(`http://${config.calcUrl}/user/login?userName=${uname}&psd=${psd}`)
|
|
|
+ .then(action)
|
|
|
+ .catch(err=>console.log(err));
|
|
|
+ }
|
|
|
+
|
|
|
/* 单例 */
|
|
|
static getInstance() {
|
|
|
if (!BackgroundData.instance) {
|