<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="用户ID" prop="customerId" v-model="form.customerId" placeholder="请输入用户ID"/>
                        <Field label="产品" prop="productId" v-model="form.productId" placeholder="请输入产品"/>
                        <Field label="平台为产品颁发的全局唯一标识符" prop="productKey" v-model="form.productKey" placeholder="请输入平台为产品颁发的全局唯一标识符"/>
                        <Field label="设备ID" prop="deviceId" v-model="form.deviceId" placeholder="请输入设备ID"/>
                        <Field label="设备名称" prop="deviceName" v-model="form.deviceName" placeholder="请输入设备名称"/>
                        <Field label="设备对该Topic的操作，可设置为发布、订阅、发布和订阅。" prop="deviceTopicHandle" v-model="form.deviceTopicHandle" type="select" :enumData="dict.deviceTopicHandle" placeholder="请选择设备对该Topic的操作，可设置为发布、订阅、发布和订阅。"/>
                        <Field label="设备的具体是topic信息，根据产品topic信息生产" prop="topic" v-model="form.topic" placeholder="请输入设备的具体是topic信息，根据产品topic信息生产"/>
                        <Field label="描述" prop="deviceTopicRemark" v-model="form.deviceTopicRemark" placeholder="请输入描述"/>
            </el-row>

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

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

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