<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)"
        @changedClick="changebj"
        v-show="initData(model, FlowData)"
        :keepHiddenCell="false"
      />
    </template>
  </sd-webflow>
</template>

<script>
import components from './_import-components/cpm-improve-feedback-form-import'

export default {
  name: 'CpmImproveFeedbackForm',
  metaInfo: {
    title: '整改反馈',
  },
  components,
  data() {
    return {
      flag: true,
    }
  },
  created() {},
  methods: {
    initData(model, FlowData) {
      if (this.flag) {
        if (this.$refs.webflow) {
          if (!this.$refs.webflow.getFieldValue('PROJECT_ID')) {
            this.$refs.webflow.setFieldValue('PROJECT_ID', this.projectId)
            this.$refs.webflow.setFieldValue('PROJECT_NAME', '项目名称')
            this.$refs.webflow.setFieldValue('PROJECT_CODE', '项目binh')
          }
          this.flag = false
        }
      }
      return true
    },
    validForm() {
      this.$refs.webflow.setFieldValue('JBXX', 'true')
      this.$refs.webflow.setFieldValue('JCXX', 'true')
      this.$refs.webflow.setFieldValue('WTZGJH', 'true')
      this.$refs.webflow.setFieldValue('WTZGJG', 'true')
      this.$refs.webflow.setFieldValue('LCZGJGLB', 'true')
      return new Promise((resolve, reject) => {
        resolve(true)
      })
    },
    changebj() {
      console.log('---change')
    },
    initDaF(array) {
      if (array) {
        array.attrFD.keepHiddenCell = false
      }
      return array
    },
    // initFormdata()
  },
}
</script>

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