<template>
|
<div class="Parametersettings">
|
<div class="Parametersettings_l">
|
<div
|
style="color: rgba(0, 9, 56, 1); font-size: 1.13rem; font-weight: bold"
|
class="title"
|
>
|
伸出缩回速度设置
|
</div>
|
<el-form
|
ref="ruleFormRef"
|
style="margin-top: 2.13rem"
|
:model="ruleForm"
|
:rules="rules"
|
label-width="auto"
|
class="demo-ruleForm"
|
label-position="top"
|
:hide-required-asterisk="true"
|
>
|
<el-form-item prop="extendSpeed">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>PLC自动伸出缩回速度m/min:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.extendSpeed"
|
/>
|
</el-form-item>
|
<!-- <el-form-item prop="retractionSpeed">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>右PLC自动伸出缩回速度m/min:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.retractionSpeed"
|
/>
|
</el-form-item> -->
|
<el-form-item prop="manualExtend">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>PLC手动伸出缩回速度m/min:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.manualExtend"
|
/>
|
</el-form-item>
|
<!-- <el-form-item prop="manualRetraction">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>右PLC手动伸出缩回速度m/min:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.manualRetraction"
|
/>
|
</el-form-item> -->
|
<el-form-item prop="leftPosition">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>左PLC自动伸到位:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.leftPosition"
|
/>
|
</el-form-item>
|
<el-form-item prop="rightPosition">
|
<template #label>
|
<span
|
style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
|
class="title_span"
|
>右PLC自动伸到位:</span
|
>
|
</template>
|
<el-input
|
style="height: 1.88rem"
|
class="title_input"
|
placeholder="请输入"
|
v-model="ruleForm.rightPosition"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<div
|
style="
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
margin-top: 10rem;
|
"
|
>
|
<el-button
|
style="height: 1.88rem; width: 5.63rem"
|
class="title_button"
|
type="primary"
|
@click="submitForm(ruleFormRef)"
|
>
|
保存
|
</el-button>
|
</div>
|
</el-form-item>
|
</el-form>
|
</div>
|
</div>
|
</template>
|
<script setup>
|
import { onMounted, ref } from "vue";
|
import { ElMessage } from "element-plus";
|
import { AddData, GetParameter } from "@/api/newapi/Parameters";
|
const userInfo = JSON.parse(localStorage.getItem("user"));
|
const ruleForm = ref({
|
creater: "string",
|
createDate: "2025-03-27T05:48:57.698Z",
|
modifier: "string",
|
modifyDate: "2025-03-27T05:48:57.698Z",
|
id: 0,
|
extendSpeed: 0,
|
retractionSpeed: 0,
|
manualExtend: 0,
|
manualRetraction: 0,
|
depid: userInfo.depid,
|
account: userInfo.userName,
|
leftPosition: 0,
|
rightPosition: 0,
|
});
|
//保存
|
const submitForm = () => {
|
ruleForm.value.retractionSpeed = ruleForm.value.extendSpeed;
|
ruleForm.value.manualRetraction = ruleForm.value.manualExtend;
|
AddData(ruleForm.value).then((res) => {
|
if (res.code == 0) {
|
ElMessage.success("保存成功");
|
}
|
});
|
};
|
//获取参数
|
const getParameter = () => {
|
GetParameter().then((res) => {
|
if (res.code == 0) {
|
ruleForm.value.extendSpeed = res.data == null ? 0 : res.data.extendSpeed;
|
ruleForm.value.retractionSpeed =
|
res.data == null ? 0 : res.data.retractionSpeed;
|
ruleForm.value.manualExtend =
|
res.data == null ? 0 : res.data.manualExtend;
|
ruleForm.value.manualRetraction =
|
res.data == null ? 0 : res.data.manualRetraction;
|
ruleForm.value.leftPosition =
|
res.data == null ? 0 : res.data.leftPosition;
|
ruleForm.value.rightPosition =
|
res.data == null ? 0 : res.data.rightPosition;
|
}
|
});
|
};
|
|
onMounted(() => {
|
getParameter();
|
});
|
</script>
|
<style lang="scss" scoped>
|
.Parametersettings {
|
display: flex;
|
justify-content: space-between;
|
.Parametersettings_l {
|
width: 100%;
|
height: 100%;
|
background-color: #fff;
|
padding: 1.44rem 1.25rem;
|
}
|
.Parametersettings_c {
|
width: 36%;
|
height: 100%;
|
background-color: #fff;
|
padding: 1.44rem 1.25rem;
|
.box {
|
.box_item {
|
width: 6.25rem;
|
height: 6.25rem;
|
background-color: #f1fcff;
|
border-radius: 50%;
|
background-color: rgba(255, 255, 255, 1);
|
border: 0.06rem solid rgba(187, 187, 187, 1);
|
}
|
}
|
}
|
.Parametersettings_r {
|
width: 25%;
|
height: 100%;
|
background-color: #fff;
|
padding: 1.44rem 1.25rem;
|
}
|
}
|
@media screen and (max-width: 1080px) {
|
.title {
|
font-size: 3rem !important;
|
}
|
.title_span {
|
font-size: 2rem !important;
|
}
|
.title_input {
|
height: 4rem !important;
|
font-size: 3rem !important;
|
}
|
.title_button {
|
height: 5rem !important;
|
width: 14rem !important;
|
font-size: 3rem !important;
|
}
|
}
|
</style>
|