<template>
  <div>
    <el-dialog  :title="title" :visible.sync="showDialog" width="900px" :close-on-click-modal="false"  :before-close="handleClose" append-to-body>
        <div style="height:calc(100vh - 350px)">
            <pictureManage ref="pictureManage" :refreshCheck="refresh" :projectId="projectId" @check="getCheck"></pictureManage>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose">取 消</el-button>
          <el-button type="primary" @click="submit" >确 定</el-button>
        </span>
    </el-dialog>
  </div>
</template>

<script>
import pictureManage from './pictureManage.vue';
export default {
  components: {
    pictureManage
  },
  props: {
    projectId:{
        default:0
    }
  },
  data() {
    return {
        title:'选择附图',
        showDialog:false,
        refresh:false,
        form:{},
        
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    open(data){
        this.refresh = true
        this.form = data
        this.showDialog = true
    },
    handleClose(){
        this.refresh = false
        this.showDialog = false
    },
    submit(){
        this.$refs.pictureManage.toParent()
        this.handleClose()
    },
    getCheck(val){
        this.form.check = val
        this.$emit('check',this.form)
    }
  },
};
</script>
<style lang="scss" scoped>
</style>