<template>
    <layout-form>
        <el-form :model="form" :loading="loading" :rules="rules" size='small' style="width:100%" label-width='120px' ref="form">
            <el-row>
                                    <Field label="设备名称，设置设备名称。" prop="deviceName" v-model="form.deviceName" placeholder="请输入设备名称，设置设备名称。"/>
                        <Field label="平台为产品颁发的全局唯一标识符" prop="productKey" v-model="form.productKey" placeholder="请输入平台为产品颁发的全局唯一标识符"/>
                        <Field label="日志类型，(0.上报事件，1.下发服务)" prop="logType" v-model="form.logType" type="select" :enumData="dict.logType" placeholder="请选择日志类型，(0.上报事件，1.下发服务)"/>
                        <el-col span="12">
                            <el-form-item label="内容">
                                <editor v-model="form.content" :min-height="192"/>
                            </el-form-item>
                        </el-col>
            </el-row>

            <form-buttons @submit='submitForm'/>
        </el-form>
    </layout-form>
</template>

<script>
    import form from "@/assets/mixins/form";
    import Editor from '@/components/Editor';
    export default {
        mixins: [form],
        components: {
            Editor,
        },
        toString:[
            "logType",
        ],
        methods: {

        },
        data() {
            return {
                rules: {
                    deviceName: [
                        {required: true, trigger: "blur" },
                    ],
                    productKey: [
                        {required: true, trigger: "blur" },
                    ],
                    logType: [
                        {required: true, type: 'integer',trigger: "blur" },
                    ],
                    content: [
                        { trigger: "blur" },
                    ],
                }
            };
        }
    };
</script>