Skip to content

表单自定义组件

代码

js
export default {
  props: {
    //组件数据
    record: {
      type: Object,
      default: () => ({})
    },
    //表数据 (在列表组件或表单组件下)
    tableData: {
      type: Object,
      default: () => ({})
    },
    //传递的数据对象
    parameterData: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {};
  },
  methods: {
    //初始化
    init() {
      console.log('初始化组件')
    }
  },
  mounted() {
    this.init()
  }
}

交互方法

js
//刷新主表单+关联视图  同表单(form) refresh
this.record.refresh(t = true, options)

//获取form数据  同表单(form) getFormAllData
this.record.getFormAllData(verification = true, all = false).then(res => {
  console.log(res);
})

刷新主表单+关联视图

  • 对应表单页方法:form/methods-system 中的 refresh(t = true, options)

获取 form 数据

  • 对应表单页方法:form/methods-system 中的 getFormAllData(verification, all)