<template>
  <sd-webflow ref="webflow" :validate-form="validForm">
    <template v-slot:form="{ model, FlowData }">
      <sd-form-by-builder
        ref="builderform"
        :form-data="initDaF(FlowData.processFormData)"
        :keep-hidden-cell="false"
      />
    </template>
  </sd-webflow>
</template>

<script>
import components from './_import-components/cpm-project-check-import'

export default {
  name: 'CpmProjectCheck',
  metaInfo: {
    title: 'CpmProjectCheck',
  },
  components,
  data() {
    return {}
  },
  created() {
    this.initData()
  },
  methods: {
    validForm() {
      return new Promise((resolve, reject) => {
        resolve(true)
      })
    },
    initDaF(array) {
      if (array) {
        array.attrFD.keepHiddenCell = false
      }
      return array
    },
    initData() {
      setTimeout(() => {
        const startDept = this.$refs.webflow.getFieldValue('START_DEPT')
        this.$refs.webflow.setFieldValue('START_DEPT_NAMES', startDept)
      })
    },
  },
}
</script>

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