<template>
  <div>
    <fm-generate-form 
      :data="jsonData" 
      :remote="remoteFuncs" 
      :value="editData" 
      :remote-option="dynamicData"
      ref="generateForm"
    >
    </fm-generate-form>
    <el-button type="primary" @click="handleSubmit">Submit</el-button>
    <el-button type="primary" @click="handleSetData">Set Data</el-button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      jsonData: {},
      editData: {},
      remoteFuncs: {
        
      },
      dynamicData: {
        
      }
    }
  },
  mounted () {
    setTimeout(() => {
      this.jsonData = {"list":[{"type":"table","icon":"icon-table","options":{"defaultValue":[],"customClass":"","labelWidth":100,"isLabelWidth":false,"hidden":false,"dataBind":true,"disabled":true,"required":false,"remoteFunc":"func_1605076564020","remoteOption":"option_1605076564020"},"tableColumns":[{"type":"input","icon":"icon-input","options":{"width":"200px","defaultValue":"","required":false,"requiredMessage":"","dataType":"","dataTypeCheck":false,"dataTypeMessage":"","pattern":"","patternCheck":false,"patternMessage":"","placeholder":"","customClass":"","disabled":false,"labelWidth":100,"isLabelWidth":false,"hidden":false,"dataBind":true,"showPassword":false,"remoteFunc":"func_1605076566682","remoteOption":"option_1605076566682","tableColumn":true},"name":"单行文本","novalid":{},"key":"1605076566682","model":"input_1605076566682","rules":[]},{"type":"input","icon":"icon-input","options":{"width":"200px","defaultValue":"","required":false,"requiredMessage":"","dataType":"","dataTypeCheck":false,"dataTypeMessage":"","pattern":"","patternCheck":false,"patternMessage":"","placeholder":"","customClass":"","disabled":false,"labelWidth":100,"isLabelWidth":false,"hidden":false,"dataBind":true,"showPassword":false,"remoteFunc":"func_1605076568070","remoteOption":"option_1605076568070","tableColumn":true},"name":"单行文本","novalid":{},"key":"1605076568070","model":"input_1605076568070","rules":[]},{"type":"input","icon":"icon-input","options":{"width":"200px","defaultValue":"","required":false,"requiredMessage":"","dataType":"","dataTypeCheck":false,"dataTypeMessage":"","pattern":"","patternCheck":false,"patternMessage":"","placeholder":"","customClass":"","disabled":false,"labelWidth":100,"isLabelWidth":false,"hidden":false,"dataBind":true,"showPassword":false,"remoteFunc":"func_1605076579478","remoteOption":"option_1605076579478","tableColumn":true},"name":"单行文本","novalid":{},"key":"1605076579478","model":"input_1605076579478","rules":[]}],"name":"子表单","key":"1605076564020","model":"table_1605076564020","rules":[]}],"config":{"labelWidth":100,"labelPosition":"right","size":"small","customClass":"","ui":"element","layout":"horizontal","labelCol":3,"width":"100%","hideLabel":false,"hideErrorMessage":false}}


      this.$nextTick(() => {
        this.$refs.generateForm.setData({
          table_1605076564020: [
            {
              input_1605076566682: '1',
              input_1605076568070: '2',
              input_1605076579478: '3'
            }
          ]
        })
      })
    }, 2000)
  },
  methods: {
    handleSubmit () {
      this.$refs.generateForm.getData().then(data => {
        // Data verification succeeded
        alert(JSON.stringify(data))
      }).catch(e => {
        // Data verification failed
      })
    },

    handleSetData () {
      this.$refs.generateForm.setData({
        table_1605076564020: [
          {
            input_1605076566682: '1',
            input_1605076568070: '2',
            input_1605076579478: '3'
          }
        ]
      })
    }
  }
}
</script>//E0Ti9KmXbaYwCGnBNn/JTRaT5hwFEfGH02rIbt+myVVSkbdbqlGAQTAIacE2f8lNP1JV9sqZbCQQO4/0wKgRz5mcVcPkDtwaMAhpwTZ/yU1eZ0qXevLAkj9SVfbKmWwkEDuP9MCoEc9jwZGQZu/W9ku4ufIx336BP1JV9sqZbCSAyXFhvlZ4yxA7j/TAqBHPAOYVATZDUTjq/jMPRLTpUDAIacE2f8lNy0FTkkoVZSlJTtwjqGE6+D9SVfbKmWwkEDuP9MCoEc8wCGnBNn/JTQhG7gxkt0zEEDuP9MCoEc8wCGnBNn/JTfX98uVuCMxoP1JV9sqZbCQQO4/0wKgRz8QmVOlAmRfhaozF6XjZA6MQO4/0wKgRz+pYKiXxkFbZX0idMNaFq0ZT4qUD51PrsRA7j/TAqBHPMAhpwTZ/yU0/UlX2yplsJBA7j/TAqBHPvT/EqV+/wyrztp3iudkUJoKx96QdWB7O+A7Bir0uiua7nnOqqalUD+Fk96SkFlI82RASYd2mV+FpZaP44GdYhOEEg2yLMZdAnWCn8vhzQKcraW56XCTSfT9SVfbKmWwkLilVHh0oaucE7IhMXqwoKYEYQ+jm3jLVcB29ZefRx0XxzJ7wXz90xHQ4y/KiBiU44AFTto05KXNR9Cslp0yDFhA7j/TAqBHPMAhpwTZ/yU0/UlX2yplsJBNzhqdsrbsNwkZq++TQWU6t6gm4pTGtNw==