export default {
  data() {
    return {}
  },
  created() {},
  methods: {
    setDefaultValue2 (obj, formDataStr, refStr) {
      this.baseSetDefaultValue(obj, false, formDataStr, refStr)
    },
    setDefaultValue (obj, formDataStr, refStr) {
      this.baseSetDefaultValue(obj, true, formDataStr, refStr)
    },
    baseSetDefaultValue (obj, resetFalg, formDataStr, refStr) {
      window.setTimeout(() => {
        const formData = formDataStr || 'formData'
        const curRef = refStr || 'ruleForm'
        let curObj = Object.assign({}, obj)
        const that = this
        that.$nextTick(() => {
          let curForm = that.$refs[curRef].baseForm
          if (resetFalg) that.$refs[curRef].$refs['baseForm'].resetFields()
          if (obj) {
            that[formData].map(item => {
              if (curObj[item.key]) {
                curForm[item.key] = curObj[item.key]
              }
            })
          }
          that.$refs[curRef].baseForm = {...curForm}
        })
      }, 200)
    }
  }
}
