<template>
  <sd-flow-form id="printForm" ref="form" :flow-data="flowData" :water-mark="waterMark" read-only>
    <template v-slot="scope">
      <slot v-bind="scope" />
    </template>
  </sd-flow-form>
</template>

<script>
import systemManage from '@/system-manage/system-manage'
import sdFormPublicMethodsNew from '@/common/components/sd-form/sd-form-public-methods-new'
import components from './_import-components/sd-print-form-import'

export default {
  name: 'SdPrintForm',
  components,
  mixins: [sdFormPublicMethodsNew],
  props: {
    flowData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      waterMark: systemManage.getPrintWaterMark(),
    }
  },
  mounted() {
    this.mergeValue()
  },
  inject: {
    webflow: { default: null },
  },
  methods: {
    mergeValue() {
      // 从 sd-webflow 取出最新的值，赋给打印表单
      this.setFieldsValue(this.webflow.getFieldsValue())
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
