<template>
    <div>
        <el-dialog title="案件流程" :visible="processVisable" @close="cancel" center :distroy-on-close="true">
            <div>
                <el-steps class="steps" :active="pageData.caseStatus">
                    <el-step :title="item.caseNodeName || item.content" v-for="(item,index) in pageData.allCasenode" :description="(item.createNickName || '') + (item.caseNodeTime || '')"></el-step>
                   
                </el-steps>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancel" class="endbutton1"><span>取 消</span></el-button>
            </div>
        </el-dialog>
    </div>
</template>
  
<script>
import {selectCaseProgress} from '@/api/caseManagement/caseManagement'
export default {
    props: ["processVisable","processData"],
    data() {
        return {
            processId:null,
            pageData:{}
        };
    },
    watch: {
        processVisable(val){
            if(val){
                this.processId = this.processData.id;
                this.selectCaseProgressFn({id:this.processId});
            }
        }
    },
    methods: {
        cancel() {
            this.$emit("cancelViewProcess");
        },
        selectCaseProgressFn(data){
            selectCaseProgress(data).then(res=>{
                console.log(res,"请求成功");
                this.pageData = res.data.data;
            })
        }
    },
};
</script>
  
<style lang="scss" scoped>
    .steps{
        display: flex;
        flex-wrap: wrap;
    }
    ::v-deep .el-step{
        // width: 150px;
        flex-basis:25% !important;
        margin-right: 20px;
        margin-bottom: 20px;
    }
</style>