<template>
     <el-dialog v-dialogDrag :title="title" :visible.sync="visible" :close-on-click-modal="false" :before-close="cancel"
        class="dialogClass" width="45%">
        <div class="addDia">
            <el-form ref="form" :model="form" label-width="120px" size="mini">
                <el-row>
                <el-col :span="12">
                    <el-form-item label="任务编号：">{{ form.jobId }}</el-form-item>
                    <el-form-item label="任务名称：">{{ form.jobName }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="任务分组：">{{ form.jobGroup=='DEFAULT'?'默认':'系统' }}</el-form-item>
                    <el-form-item label="创建时间：">{{ form.createTime }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="cron表达式：">{{ form.cronExpression }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="任务状态：">
                        <el-tag :type="form.status==0?'success':'info'">{{ form.status==0?'启动':'暂停' }}</el-tag>
                    </el-form-item>
                </el-col>
                <el-col :span="24">
                    <el-form-item label="调用目标方法：">{{ form.invokeTarget }}</el-form-item>
                </el-col>
                
                <el-col :span="12">
                    <el-form-item label="是否并发：">
                    <div v-if="form.concurrent == 0">允许</div>
                    <div v-else-if="form.concurrent == 1">禁止</div>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="执行策略：">
                    <div v-if="form.misfirePolicy == 0">默认策略</div>
                    <div v-else-if="form.misfirePolicy == 1">立即执行</div>
                    <div v-else-if="form.misfirePolicy == 2">执行一次</div>
                    <div v-else-if="form.misfirePolicy == 3">放弃执行</div>
                    </el-form-item>
                </el-col>
                </el-row>
                <el-form-item>
                    <el-button icon="el-icon-circle-close" size="mini" @click="cancel" type="info">关闭</el-button>
                </el-form-item>
            </el-form>
        </div>
    </el-dialog>   
    
</template>

<script>
export default{
    data(){
        return {

        }
    },
    props:{
        title:{
            type:String,
            default:()=>'任务详情'
        },
        visible:{
            type:Boolean,
            default:()=>false
        },
        form:{
            type:Object,
            default:()=>{}
        }
    },
    methods:{
        cancel(){
            this.$emit('cancel')
        }
    }
}
</script>

<style lang="scss" scoped></style>