<template>
  <el-dialog
    center
    :title="title"
    :visible.sync="visible"
    :width="width"
    @close="close"
    :append-to-body="appendToBody"
    :close-on-click-modal="closeModal"
    top="5vh"
  >
    <div class="main">
      <ConfigForms
        :key="patientId"
        isDialogEdit
        :form-type="formType"
        :disabled="disabled"
        :tab-disabled="tabDisabled"
        :patient-id="patientId"
        :isDraft="isDraft"
        :operation="operation"
        @changeShow="changeShow"
      ></ConfigForms>
    </div>
  </el-dialog>
</template>

<script>
import ConfigForms from "@/views/screening/components/ConfigForms.vue"
export default {
  components: { ConfigForms },
  name: "DialogConfigForms",
  data() {
    return {
      loading: false,
      visible: false,
      disabled: false,
      tabDisabled: true,
      screenList: [],
    }
  },
  props: {
    formType: String,
    operation: String,
    isDraft: String,
    patientId: String,
    followId: String,
    confirmText: {
      type: String,
      default: "确 认",
    },
    appendToBody: {
      type: Boolean,
      default: false,
    },
    closeModal: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: "修改",
    },

    width: {
      type: String,
      default: "80%",
    },
  },
  provide() {
    return {
      tabFollowId: () => this.followId,
    }
  },
  methods: {
    open() {
      this.visible = true
    },

    close() {
      this.loading = false
      this.visible = false
    },

    handleConfirm() {
      this.loading = true
    },

    changeShow() {
      this.close()
    },
  },
  watch: {
    visible() {
      if (this.visible) {
      } else {
        this.$emit("update")
      }
    },
  },
  computed: {},
}
</script>

<style lang="scss" scoped>
.el-dialog__wrapper ::v-deep .el-dialog__header {
  display: none;
}
</style>
