<template>
    <div>
      <el-drawer class="custom-drawer-form" size="1000px" :with-header="false" :visible.sync="drawer" direction="rtl" :before-close="close" destroy-on-close append-to-body>
          <div style="padding:10px;height:100%">
            <questionIndex :scenarioId="params.scenarioId" :isOperate='2' @submit="submit"></questionIndex>
          </div>
      </el-drawer>
    </div>
</template>
  
<script>
  export default {
    name:'eventDrawer',
    components: {
        questionIndex:() => import('@/views/event/components/index.vue')
    },
    props: {},
    data() {
      return {
          //控制弹窗是否显示
          drawer:false,
          //应用场景的信息
          params:{},
          isEdit:false
      };
    },
    watch: {},
    computed: {},
    created() {},
    mounted() {
    },
    methods: {
        //打开抽屉
        open(scenarioName, scenarioId){
          this.params = {
              scenarioName:scenarioName, 
              scenarioId:scenarioId, 
          }
          this.isEdit = false
          this.drawer = true
        },
        //关闭抽屉
        close(){
          if(this.isEdit){
            this.$emit('close')
          }
          this.drawer = false
        },
        submit(val){
          this.isEdit = val
        }
    },
  };
  </script>
  <style lang="scss">
  </style>