<template>
|
<div class="content">
|
<el-button type="primary" size="small" @click="this.$router.push({ path: 'home' })">返回</el-button>
|
|
<h3>子车参数设置</h3>
|
<div>
|
<div class="item" v-for="item in childerParm" :key="item.dbAddress">
|
<el-row>
|
<el-col :span="2"> </el-col>
|
<el-col :span="8">
|
<div class="lable">{{ item.name }}</div>
|
</el-col>
|
<el-col :span="8">
|
<el-input size="small" type="number" placeholder="请输入值" v-model="item.value"></el-input>
|
</el-col>
|
<el-col :span="4"> </el-col>
|
</el-row>
|
</div>
|
</div>
|
<div class="buttom">
|
<el-button type="success" size="small" @click="SaveAndSet">保存并设置</el-button>
|
<el-button type="primary" size="small" @click="GetChidlerParm(true)">刷新</el-button>
|
</div>
|
|
</div>
|
</template>
|
|
<script>
|
import { ElMessage as Message } from 'element-plus';
|
|
export default {
|
data() {
|
return {
|
childerParm: "" //子车参数
|
};
|
},
|
mounted() {
|
this.GetChidlerParm();
|
},
|
methods: {
|
GetChidlerParm(isRefrence) {
|
this.http.post("/api/Childer/GetChidlerParm", {}, true).then((x) => {
|
if (!x.status)
|
return Message.error(x.message);
|
this.childerParm = JSON.parse(x.data);
|
if (isRefrence) {
|
Message.success('刷新成功');
|
}
|
});
|
},
|
SaveAndSet() {
|
this.http.post("/api/Childer/SetChilderParm", this.childerParm, true).then((x) => {
|
if (!x.status)
|
return Message.error(x.message);
|
Message.success(x.message);
|
});
|
}
|
},
|
}
|
</script>
|
|
<style scoped>
|
.content {
|
margin: 20px auto;
|
width: 50%;
|
border: 1px solid red;
|
padding: 10px;
|
border-radius: 5px;
|
}
|
|
h3 {
|
text-align: center;
|
padding-bottom: 10px;
|
}
|
|
.item {
|
margin-top: 10px;
|
}
|
|
.lable {
|
font-size: 13.5px;
|
text-align: right;
|
padding-right: 10px;
|
}
|
|
.buttom {
|
margin-top: 8px;
|
display: flex;
|
justify-content: space-around;
|
}
|
</style>
|