| | |
| | | datas: [], //cc |
| | | loadings: true, //等待 |
| | | querys: {}, //搜索 |
| | | isEdit:false, |
| | | isEdit: false, |
| | | pages: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | // form是表单或者表格绑定的数据集,v-model='form' |
| | | handler(val) { |
| | | if (val) { |
| | | if(that.isEdit){ |
| | | if (that.isEdit) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | this.form.wd = val.latitude; |
| | |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit"].includes(type)) { |
| | | that.isEdit=true; |
| | | that.isEdit = true; |
| | | getDetail(this.form.id).then((res) => { |
| | | if (this.form.type == "1") { |
| | | const data = res.data.data; |
| | |
| | | } |
| | | |
| | | if (["edit"].includes(type)) { |
| | | that.isEdit=false; |
| | | that.isEdit = false; |
| | | } |
| | | done(); |
| | | }, |
| | |
| | | if (dat.length > 0) { |
| | | for (var key in dat) { |
| | | let states; |
| | | if (dat[key].state != "") { |
| | | states = "故障"; |
| | | } else { |
| | | if (dat[key].jtype != 1) { |
| | | if (dat[key].onlineStatus == 1) { |
| | | states = "在线"; |
| | | } else { |
| | | states = "掉线"; |
| | | } |
| | | } else { |
| | | states = "预警"; |
| | | } |
| | | } |
| | | // if (dat[key].state != "") { |
| | | // states = "故障"; |
| | | // } else { |
| | | // if (dat[key].jtype != 1) { |
| | | // if (dat[key].onlineStatus == 1) { |
| | | // states = "在线"; |
| | | // } else { |
| | | // states = "掉线"; |
| | | // } |
| | | // } else { |
| | | // states = "预警"; |
| | | // } |
| | | // } |
| | | states = |
| | | dat[key].dtype == 0 |
| | | ? "掉线" |
| | | : dat[key].dtype == 1 |
| | | ? "正常" |
| | | : dat[key].dtype == 2 |
| | | ? "预警" |
| | | : dat[key].dtype == 3 |
| | | ? "故障" |
| | | : ""; |
| | | // console.log(states); |
| | | dat[key].states = states; |
| | | dat[key].stateSevicestate = |