<template>
|
<div class="qhuan">
|
<div v-for="item in datalist">
|
|
<div v-if="item.stationLocation === '2033'">
|
|
<el-button class="bun1" type="success" v-if="item.stationStatus === '1'"
|
v-on:click="selectss(1)">1号压装机</el-button>
|
|
<el-button class="bun1" type="danger" v-if="item.stationStatus === '0'"
|
v-on:click="selectss(1)">1号压装机</el-button>
|
<p>
|
1号压装机 :
|
<el-tag type="success" v-if="item.stationStatus === '1'">启用</el-tag>
|
<el-tag type="danger" v-if="item.stationStatus === '0'">禁用</el-tag>
|
</p>
|
</div>
|
|
|
<div v-if="item.stationLocation === '2043'">
|
<el-button class="bun2" type="success" v-if="item.stationStatus === '1'"
|
v-on:click="selectss(2)">2号压装机</el-button>
|
<el-button class="bun2" type="danger" v-if="item.stationStatus === '0'"
|
v-on:click="selectss(2)">2号压装机</el-button>
|
<p>
|
2号压装机 :
|
<el-tag type="success" v-if="item.stationStatus === '1'">启用</el-tag>
|
<el-tag type="danger" v-if="item.stationStatus === '0'">禁用</el-tag>
|
</p>
|
</div>
|
</div>
|
</div>
|
|
</template>
|
<script>
|
import axios from 'axios';
|
export default {
|
data() {
|
return {
|
datalist: [],
|
url: "http://192.168.12.189/:8098/api/",
|
|
};
|
},
|
mounted() {
|
// setInterval(() => {
|
this.AddTask();
|
// }, 5000);
|
|
},
|
created() {
|
// this.AddTask();
|
// this.selList();
|
},
|
|
methods: {
|
//切换
|
selectss(selvelue) {
|
|
axios.post("http://172.21.1.139:9291/api/StationManager/UpdateStation",{MainData: {
|
stationid: selvelue,
|
}})
|
.then(response => {
|
if(response.data.status){
|
this.AddTask();
|
}else{
|
alert(selvelue)
|
}
|
|
|
})
|
},
|
AddTask() {
|
axios.post("http://172.21.1.139:9291/api/StationManager/GetStation")
|
.then(response => {
|
if(response.status){
|
this.datalist = response.data.data;
|
}
|
|
})
|
}
|
|
},
|
|
props: {
|
value: String
|
}
|
|
}
|
</script>
|