艺术家
2025-05-22 52756e8a22ff5d3c5e9cf90dfa5b87742c60350d
ÏîÄ¿´úÂë/ÉìËõ¸Ë/client/src/views/tts/Parametersettings/Parametersettings.vue
@@ -19,7 +19,7 @@
        <el-form-item prop="extendSpeed">
          <template #label>
            <span style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
              >自动伸出速度m/min:</span
              >å·¦PLC自动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
@@ -31,7 +31,7 @@
        <el-form-item prop="retractionSpeed">
          <template #label>
            <span style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
              >自动缩回速度m/min:</span
              >右PLC自动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
@@ -43,7 +43,7 @@
        <el-form-item prop="manualExtend">
          <template #label>
            <span style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
              >手动伸出速度m/min:</span
              >å·¦PLC手动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
@@ -55,13 +55,37 @@
        <el-form-item prop="manualRetraction">
          <template #label>
            <span style="color: rgba(0, 9, 56, 1); font-size: 0.88rem"
              >手动缩回速度m/min:</span
              >右PLC手动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            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"
              >å·¦PLC自动伸到位:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            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"
              >右PLC自动伸到位:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            placeholder="请输入"
            v-model="ruleForm.rightPosition"
          />
        </el-form-item>
        <el-form-item>
@@ -179,9 +203,9 @@
  </div>
</template>
<script setup>
import { ref } from "vue";
import { onMounted, ref } from "vue";
import { ElMessage } from "element-plus";
import { AddData } from "@/api/newapi/Parameters";
import { AddData, GetParameter } from "@/api/newapi/Parameters";
const userInfo = JSON.parse(localStorage.getItem("user"));
const ruleForm = ref({
  creater: "string",
@@ -194,16 +218,42 @@
  manualExtend: 0,
  manualRetraction: 0,
  depid: userInfo.depid,
  account: userInfo.userName,
  leftPosition: 0,
  rightPosition: 0,
});
//保存
const submitForm = () => {
  console.log(ruleForm.value);
  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 {