<script setup lang="ts">
import { orgFormConfig } from '@/utils/constants'
import { createOrg, updateOrg } from '@/api/org'

const curOrg = ref<any>({})
const handleOrgClick = (item: any) => {
  curOrg.value = item
  formData.value = item
}

const formData = ref<any>({})
const formRef = ref('')
</script>

<template>
  <org-layout @click="handleOrgClick">
    <pro-form
      v-if="curOrg.id"
      class="p-[15px]"
      ref="formRef"
      :formConfig="orgFormConfig"
      :formData="formData"
      :create="createOrg"
      :update="updateOrg"
    ></pro-form>
    <el-empty v-else description="请选择左侧数据后操作"></el-empty>
  </org-layout>
</template>

<style lang="scss" scoped></style>
