燕山石化溯源三维电子沙盘-【前端】-Web
WX
2023-08-11 b01346e041ffa205d69fddffa8c6f78cbeb307af
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
<template>
  <div class="SZ_box">
    <div class="SZ_title">数值设置</div>
    <div class="form_box">
      <div class="inp_box">
        <span>报警值设置</span>
        <el-input v-model="data.BJ" size="large" />
      </div>
      <div class="inp_box">
        <span>预警值设置</span>
        <el-input v-model="data.YJ" size="large" />
      </div>
      <div class="button_box">
        <el-button size="small" @click="selectList" class="button"
          >确认</el-button
        >
      </div>
    </div>
  </div>
</template>
 
<script>
import { reactive, onMounted, watch, ref } from "vue";
import { useStore } from "vuex";
import { bjyjControllerUpdate, bjyjControllerGetAll } from "@/api/api.js";
import { FormInstance, ElMessage, ElMessageBox } from "element-plus";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  setup(props) {
    let data = reactive({
      BJ: "",
      YJ: "",
      bjData: {},
    });
 
    const selectList = async () => {
      ElMessageBox.confirm("确定是否修改", "Warning", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          data.bjData.jcbj = data.BJ;
          data.bjData.jcyj = data.YJ;
          const dt = await bjyjControllerUpdate(data.bjData);
          if (dt.code != 200) {
            return ElMessage.error("修改失败");
          }
          ElMessage({
            message: "修改成功",
            type: "success",
          });
        })
        .catch(() => {});
    };
    const getBJ = async () => {
      // debugger
      const dt = await bjyjControllerGetAll();
      data.bjData = dt.result[0];
      data.BJ = data.bjData.jcbj;
      data.YJ = data.bjData.jcyj;
    };
    getBJ();
    return { data, selectList, getBJ };
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.SZ_box {
  // width: calc(742px * 1);
  height: calc(200px * 1);
  // position: absolute;
  // right: 70px;
  // top: 730px;
  background: url("../assets/img/d.png") no-repeat center;
  background-size: 100% 100%;
  padding: 40px;
  box-sizing: border-box;
  .SZ_title {
    font-size: 30px;
    font-weight: bold;
    color: #ffffff;
    padding-bottom: 30px;
  }
}
.form_box {
  display: flex;
  justify-content: space-around;
  align-items: center;
  .inp_box {
    margin-right: 20px;
    span {
      font-size: 24px;
      font-weight: 400;
      color: #ffffff;
      padding-right: 10px;
    }
    .el-input {
      width: 140px;
    }
    .el-input /deep/ .el-input__wrapper {
      background: rgba(0, 0, 0, 0.2);
      border: 2px solid #2e58cc;
      border-radius: 10px;
      color: #ffffff;
      padding: 0;
      padding-left: 3px;
    }
    .el-input /deep/ .el-input__inner {
      color: #ffffff;
      font-size: 24px;
    }
  }
}
.el-button {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid #2e58cc;
  border-radius: 10px;
  color: #ffffff;
}
</style>