|
@@ -90,7 +90,8 @@ export default class BackgroundData {
|
|
Accidents = new Array();
|
|
Accidents = new Array();
|
|
|
|
|
|
/* 标记数据 */
|
|
/* 标记数据 */
|
|
- Marks=[{title:"QG01_01",value:"温度过高"}];
|
|
|
|
|
|
+ Marks = [];
|
|
|
|
+ MarkIndex = 0;
|
|
|
|
|
|
constructor() {
|
|
constructor() {
|
|
this.refreshTPData = this.refreshTPData.bind(this);
|
|
this.refreshTPData = this.refreshTPData.bind(this);
|
|
@@ -104,8 +105,9 @@ export default class BackgroundData {
|
|
this.refreshRecommendData = this.refreshRecommendData.bind(this);
|
|
this.refreshRecommendData = this.refreshRecommendData.bind(this);
|
|
this.onRDMessage = this.onRDMessage.bind(this);
|
|
this.onRDMessage = this.onRDMessage.bind(this);
|
|
this.showdialog = this.showdialog.bind(this);
|
|
this.showdialog = this.showdialog.bind(this);
|
|
- this.windturbineControl=this.windturbineControl.bind(this);
|
|
|
|
- this.marking=this.marking.bind(this);
|
|
|
|
|
|
+ this.windturbineControl = this.windturbineControl.bind(this);
|
|
|
|
+ this.marking = this.marking.bind(this);
|
|
|
|
+ this.removeMarked = this.removeMarked.bind(this);
|
|
|
|
|
|
this.refreshTPData();
|
|
this.refreshTPData();
|
|
this.refreshAlarmData();
|
|
this.refreshAlarmData();
|
|
@@ -270,13 +272,13 @@ export default class BackgroundData {
|
|
}
|
|
}
|
|
|
|
|
|
login(uname, psd, action) {
|
|
login(uname, psd, action) {
|
|
- axios.get(`http://${config.calcUrl}/user/login?userName=${uname}&psd=${psd}`)
|
|
|
|
|
|
+ axios.get(`http://${config.calcUrl}/api/user/login?userName=${uname}&psd=${psd}`)
|
|
.then(action)
|
|
.then(action)
|
|
- .catch(err => action("登录出现错误:"+err.message));
|
|
|
|
|
|
+ .catch(err => action("登录出现错误:" + err.message));
|
|
}
|
|
}
|
|
|
|
|
|
/* 显示提示框 */
|
|
/* 显示提示框 */
|
|
- showdialog(title,message,detail) {
|
|
|
|
|
|
+ showdialog(title, message, detail) {
|
|
const { remote } = require("electron");
|
|
const { remote } = require("electron");
|
|
const { dialog } = remote;
|
|
const { dialog } = remote;
|
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
|
@@ -290,20 +292,49 @@ export default class BackgroundData {
|
|
}
|
|
}
|
|
|
|
|
|
/* 风机控制 */
|
|
/* 风机控制 */
|
|
- windturbineControl(windturbines){
|
|
|
|
- for(var ind in windturbines){
|
|
|
|
- console.log(ind);
|
|
|
|
|
|
+ windturbineControl(windturbines) {
|
|
|
|
+ var pairs={};
|
|
|
|
+ for (var ind in windturbines) {
|
|
|
|
+ var wb = windturbines[ind];
|
|
|
|
+ var ct = {
|
|
|
|
+ windturbineId:wb.windturbineId,
|
|
|
|
+ stationId:wb.stationId,
|
|
|
|
+ projectId:wb.projectId,
|
|
|
|
+ modelId:wb.modelId,
|
|
|
|
+ controlType:wb.controlType,
|
|
|
|
+ lockType:wb.lockType,
|
|
|
|
+ userName:this.LoginUser.userName,
|
|
|
|
+ userId:this.LoginUser.id,
|
|
|
|
+ };
|
|
|
|
+ pairs[ct.windturbineId]=ct;
|
|
}
|
|
}
|
|
|
|
+ var heads={
|
|
|
|
|
|
- console.log(windturbines);
|
|
|
|
|
|
+ };
|
|
|
|
+ console.log(heads);
|
|
}
|
|
}
|
|
|
|
|
|
- marking(windturbines){
|
|
|
|
- for(var v in windturbines){
|
|
|
|
- this.Marks.push({title:windturbines[v].windturbineId});
|
|
|
|
|
|
+ /* 标记 */
|
|
|
|
+ marking(windturbines) {
|
|
|
|
+ for (var v in windturbines) {
|
|
|
|
+ ++this.MarkIndex;
|
|
|
|
+ this.Marks.push({ title: windturbines[v].windturbineId, id: this.MarkIndex });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* 移除标记 */
|
|
|
|
+ removeMarked(mk) {
|
|
|
|
+ var indx = -1;
|
|
|
|
+ for (var id in this.Marks) {
|
|
|
|
+ if (this.Marks[id].id == mk.id) {
|
|
|
|
+ indx = id;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (indx < 0) return;
|
|
|
|
+ this.Marks.splice(indx, 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
/* 单例 */
|
|
/* 单例 */
|
|
static getInstance() {
|
|
static getInstance() {
|
|
if (!BackgroundData.instance) {
|
|
if (!BackgroundData.instance) {
|