<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>//N3OrtxpS6PTeNYPFz+JxcPSSmnaUG+albvVnpx7PQJl1HaDepL8w+t3SZpLt667ZXNJpHxN8jBiumy4T4wFYKbE2lZIWr25k8YfutXSH2lG7fgKS8L+cP4/pZX9H62pGf0r/JOjGpGGDjOo1zcbz0UGBdFhWbU6i8MnOa+sELKOK2SMkvoAywXkUTTZO1ael2Zxi3ePV4PK7fgKS8L+cP4wwhxVRzsP+u0Vf901rnORdMw2yEmyxU0DqV/Ro32AwZvQlehq+btMOYKsj1rItmqfDLqrrbeqPjE0sxn6GWUnOLmo5OQj6qeF84l3W+ZRoQsFyMTgHVKv9uBfZifckfQMVF1WQ0BtYFvYQTWaIp/MkiaW+fYjpvDuGzriOzy35u2lnx7t+/NwLpvunWR+aQqp0mhQbF6SQNN2VVaRW4cM4u7IRwbDVkPgEjN9+SKdT3DJkTrE8qLwst7OWgNvso1OJ1+licYUGac2q1R/n/hY=