<template>
    <div class="deviceConfig">
        <h2 style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd">设备配置</h2>
        <section class="section">
            <el-row type="flex">
                <el-col :span="20">
                    <el-form
                        ref="deviceConfig"
                        :model="formData"
                        :rules="rules"
                        label-width="140px"
                    >
                        <el-form-item label="服务器地址">
                            <el-input v-model="formData.serverAddress"></el-input>
                        </el-form-item>
                        <el-form-item label="上传间隔">
                            <el-input v-model="formData.timeInterval">
                                <template slot="append">分钟 [ 1-60 ]</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="1-3日龄高温">
                            <el-input v-model="formData.T1_3">
                                <template slot="append">摄氏度 [ 20-35℃ ]</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="4-7日龄高温">
                            <el-input v-model="formData.T4_7">
                                <template slot="append">摄氏度 [ 20-35℃ ]</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="8-14日龄高温">
                            <el-input v-model="formData.T8_14">
                                <template slot="append">摄氏度 [ 20-35℃ ]</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="15-30日龄高温">
                            <el-input v-model="formData.T15_30">
                                <template slot="append">摄氏度 [ 20-35℃ ]</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-row type="flex" justify="end">
                                <el-button type="primary" @click="submitForm('deviceConfig')">保 存</el-button>
                            </el-row>
                        </el-form-item>
                    </el-form>
                    <p>本机系列号：4579285745856</p>
                </el-col>
            </el-row>
        </section>
    </div>
</template>


<script>
const rules = {};

export default {
    name: "deviceConfig",
    data() {
        return {
            rules,
            formData: {}
        };
    },
    created() {},
    methods: {
        submitForm(formName) {
            this.$refs[formName].validate(valid => {
                if (valid) {
                    console.log("555")
                } else {
                    return false;
                }
            });
        },
    }
};
</script>

<style lang="scss" scoped>
.deviceConfig {
    .section {
        width: 650px;
        background-color: #eee;
        border-radius: 15px;
        padding: 30px;
    }
}
</style>