<template>
    <el-dialog
        title="新增"
        width="900px"
        :visible.sync="visible"
        :before-close="_close"
    >
        <div>
            <el-form :model="form" :rules="rules" ref="form" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
                <el-form-item label="名称:" prop="name" style="width:50%">
                    <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
                </el-form-item>
                <el-form-item label="排序 : " prop="name" style="width:50%">
                    <el-input v-model="form.sort" placeholder="" maxlength="30"></el-input>
                </el-form-item>
                <el-form-item label="备注 : " prop="remark" style="width:100%;">
                    <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="remark"></el-input>
                </el-form-item>
            </el-form>
        </div>
        <div slot="footer" class="dialog-footer">
            <el-button @click="hide">取 消</el-button>
            <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
        </div>
    </el-dialog>         
</template>

<script>
export default {
    data(){
        return{
            visible:false,
            form:{
                name:''
            },
            submitLoading:false,
            parentid:0,
            
        }
    },
    methods:{
        _close: function(done) {
            done()
        },
        clear: function() {
            this.form.id = 0;
            this.form.name = "";
            this.form.intro = "";
        },
        show(id) {
            this.visible = true
            this.parentid = id
        },
        hide() {
            this.visible = false
        },
    }
}
</script>

