pengwei
2025-05-15 b9260c7807d064f2b77ef9e92005a8c3257ec2e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<template>
  <div class="Parametersettings">
    <div class="Parametersettings_l">
      <div
        style="color: rgba(0, 9, 56, 1); font-size: 1.13rem; font-weight: bold"
      >
        伸出缩回速度设置
      </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"
              >左PLC自动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            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"
              >右PLC自动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            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"
              >左PLC手动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            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"
              >右PLC手动伸出缩回速度m/min:</span
            >
          </template>
          <el-input
            style="height: 1.88rem"
            placeholder="请输入"
            v-model="ruleForm.manualRetraction"
          />
        </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"
              @click="resetForm(ruleFormRef)"
              >取消</el-button
            >
            <el-button
              style="height: 1.88rem; width: 5.63rem"
              type="primary"
              @click="submitForm(ruleFormRef)"
            >
              保存
            </el-button>
          </div>
        </el-form-item>
      </el-form>
    </div>
    <!-- <div class="Parametersettings_c">
      <div
        style="color: rgba(0, 9, 56, 1); font-size: 1.13rem; font-weight: bold"
      >
        PLC信号监控
      </div>
      <div
        class="box"
        style="
          display: flex;
          justify-content: space-between;
          flex-wrap: wrap;
          padding: 0 5.25rem;
          margin-top: 3.03rem;
        "
      >
        <el-row>
          <el-col style="display: flex; justify-content: space-between">
            <div class="box_item"></div>
            <div class="box_item"></div>
            <div class="box_item"></div>
          </el-col>
          <el-col
            style="
              display: flex;
              justify-content: space-between;
              margin-top: 2.78rem;
            "
            ><div class="box_item"></div>
            <div class="box_item"></div>
            <div style="width: 6.25rem; height: 6.25rem"></div
          ></el-col>
        </el-row>
      </div>
    </div>
    <div class="Parametersettings_r">
      <div
        style="color: rgba(0, 9, 56, 1); font-size: 1.13rem; font-weight: bold"
      >
        故障处理
      </div>
      <div
        style="
          display: flex;
          flex-direction: column;
          margin-top: 4.19rem;
          align-items: center;
          justify-content: space-around;
          height: 40%;
        "
      >
        <el-button
          type="primary"
          style="
            width: 7.38rem;
            height: 2.75rem;
            background-color: rgba(230, 160, 0, 1);
            color: rgba(255, 255, 255, 1);
            font-size: 1rem;
            margin-left: 1rem;
          "
          >回原点</el-button
        >
        <el-button
          type="primary"
          style="
            width: 7.38rem;
            height: 2.75rem;
            background-color: rgba(0, 207, 55, 1);
            color: rgba(255, 255, 255, 1);
            font-size: 1rem;
          "
          >复位</el-button
        >
        <el-button
          type="primary"
          style="
            width: 7.38rem;
            height: 2.75rem;
            background-color: rgba(255, 0, 0, 1);
            color: rgba(255, 255, 255, 1);
            font-size: 1rem;
          "
          >清除故障</el-button
        >
      </div>
    </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,
});
 
//保存
const submitForm = () => {
  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;
    }
  });
};
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;
  }
}
</style>