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

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

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