<template>
  <el-container>
    <el-main class="creator">
      <el-container class="creator-container">
        <el-aside class="creator-tool-box" width="357px">
          <ToolBox >
          </ToolBox>
        </el-aside>
        <el-main class="creator-editor-box">
          <EditorBox v-if="survey" :disabled="false"  :surveyModel="survey" :surveyConfig="config"/>
        </el-main>
      </el-container>
    </el-main>
  </el-container>
</template>

<script>
import ToolBox from '../components/ToolBox'
import EditorBox from '../components/EditorBox'

export default {
  name: 'Creator',
  display: 'Transitions',
  props: {
    surveyData: {
      default: function () {
        return {
        }
      }
    }
  },
  components: {
    EditorBox,
    ToolBox,
  },
  data () {
    return {
      survey: this.surveyData,
      config: {
        dataChange: (survey) => {
          
        },
        paperTitleChange: title => {
          /** 对问卷名称的其他操作 */
          return {
            code: 'failure', // success | failure
            msg: this.$t('general.msgRepeatQuest')
          }
        },
        otherSettingChange: (otherSetting) => {
          console.log('-------otherSettingChange:', otherSetting)
        },
        currentUser: ''
      }
    }
  },
  methods: {
    saveSurvey: function (survey, trigger) {
      this.$emit('change', survey)
    }
  }
}
</script>
