安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-08-24 079131b6a70ecec89a98fcf80894758847718f96
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
<script setup>
import airControlModule from "@/views/airConditioning/js/airControlModule";
import {onMounted, reactive} from "vue";
const {
    isCanSet,
    airParam,
    getParam,
    setParam,
} = airControlModule();
 
const layout = reactive({
    gutter: 16,
    span: 24
});
 
const emits = defineEmits(['close']);
 
const setAirParam = async ()=>{
    const isSuccess = await setParam();
    console.log(isSuccess);
    if(isSuccess) {
        emits('close', false);
    }
}
 
// onMounted(()=>{
//     getParam();
// });
</script>
 
<template>
<div class="el-dialog-container">
    <div class="el-dialog-content">
        <el-form
            ref="formRef"
            label-position="top"
            :model="airParam">
            <el-row :gutter="layout.gutter">
                <el-col :span="layout.span">
                    <el-form-item label="空调温度(℃)">
                        <el-input v-model="airParam.stTemp" />
                    </el-form-item>
                </el-col>
                <el-col :span="layout.span">
                    <el-form-item label="空调湿度(%RH)">
                        <el-input v-model="airParam.stHumid" />
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
    <div class="el-dialog-footer">
        <el-button type="primary" @click="getParam">读取</el-button>
        <el-button type="success" :disabled="!isCanSet" @click="setAirParam">设置</el-button>
        <el-button type="success" @click="setAirParam">设置</el-button>
    </div>
</div>
</template>
 
<style lang="less" scoped>
.el-dialog-container {
    width: 400px;
    box-sizing: border-box;
    background-color: #FFFFFF;
}
.el-dialog-content {
    box-sizing: border-box;
    padding: 8px 16px;
}
.el-dialog-footer {
    padding: 8px;
    text-align: right;
    background-color: #f5f4f4;
}
</style>