Commit 734776b5 authored by 吴雪燕's avatar 吴雪燕

修改使用接口的方式显示测试环境

parent b62000e2
This diff is collapsed.
......@@ -19,6 +19,7 @@
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vue-table-with-tree-grid": "^0.2.4"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
......@@ -80,8 +81,8 @@
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.11.5",
"webpack-merge": "^4.1.0"
"webpack-merge": "^4.1.0",
"webpack-dev-server": "^2.11.5"
},
"engines": {
"node": ">= 6.0.0",
......
......@@ -33,6 +33,7 @@ export default {
isDisable: false, //测试完成后置灰按钮
isChecked: false,
startDate: [],
list:[],
tableData: [
// {
// date: '2016-05-02',
......@@ -86,6 +87,7 @@ export default {
}).then(res => {
console.log(res);
let list = res.data;
this.list = list;
list.forEach(item =>{
this.startDate.push({
name:item.desc,
......@@ -117,8 +119,6 @@ export default {
onCLickTest() {
this.init();
this.tableData = JSON.parse(JSON.stringify(this.startDate))
// this.tableData = [...this.startDate];
// console.log("dddddddddddddddd");
this.isLoading = true;
setTimeout(() => {
let data = { t: 'start' };
......@@ -158,16 +158,13 @@ export default {
console.log(msg.data);
let data = JSON.parse(msg.data)
let msgResData = data.data;
let obj = {
net: '网络连接状态',
can: 'CAN通讯状态',
blue: '蓝牙通讯状态',
usb: 'USB通讯状态',
'485': 'RS485通讯状态'
};
let obj = {}
this.list.forEach(item =>{
obj[item.opt] = item.desc
})
// console.log(obj,msgResData);
this.tableData.forEach(element => {
if (element.name === obj[msgResData.link]) {
if (element.name == obj[msgResData.link]) {
element.status = msgResData.status;
element.time = this.dateToString();
}
......
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