<template>
  <div class="modalSty" ref="refModel">
    <a-modal
      v-model:visible="visible"
      title="新增专家信息"
      @ok="handleOk"
      width="800px"
      :bodyStyle="{ padding: '20px' }"
      :getContainer="() => $refs.refModel"
    >
      <a-row>
        <a-col :span="24">
          <div class="left">
            <a-form
              :model="formState"
              name="basic"
              :label-col="{ style: { width: '100px' } }"
              autocomplete="off"
              @finish="onFinish"
              @finishFailed="onFinishFailed"
            >
              <a-row>
                <a-col :span="12">
                  <a-form-item
                    label="所属领域"
                    name="username"
                    :rules="[{ required: true, message: 'Please input your username!' }]"
                  >
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item
                    label="所属行业"
                    name="username"
                    :rules="[{ required: true, message: 'Please input your username!' }]"
                  >
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item
                    label="专家姓名"
                    name="username"
                    :rules="[{ required: true, message: 'Please input your username!' }]"
                  >
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="性别">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item label="年龄">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item
                    label="所属单位"
                    name="username"
                    :rules="[{ required: true, message: 'Please input your username!' }]"
                  >
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item label="职称">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="职务">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item label="最高学历">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="学位">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item
                    label="联系电话"
                    name="username"
                    :rules="[{ required: true, message: 'Please input your username!' }]"
                  >
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="邮箱">
                    <a-input v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="24">
                  <a-form-item label="荣誉">
                    <a-textarea v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="24">
                  <a-form-item label="研究成果">
                    <a-textarea v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="24">
                  <a-form-item label="进修情况">
                    <a-textarea v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="24">
                  <a-form-item label="备注">
                    <a-textarea v-model:value="formState.username" />
                  </a-form-item>
                </a-col>
              </a-row>
            </a-form>
          </div>
        </a-col>
      </a-row>
    </a-modal>
  </div>
</template>
<script setup lang="ts">
  import { ref, reactive } from 'vue';
  const visible = ref(false);
  const handleOk = (e) => {
    console.log(e);
    visible.value = false;
  };
  //
  const formState = reactive({
    username: '',
    password: '',
    remember: true,
  });
  const onFinish = (values) => {
    console.log('Success:', values);
  };
  const onFinishFailed = (errorInfo) => {
    console.log('Failed:', errorInfo);
  };
  //
  function show() {
    visible.value = true;
  }
  //   编译器宏,暴露出方法
  defineExpose({
    show,
  });
</script>
<style lang="less" scoped>
  :deep(.ant-modal-header) {
    background-color: #2d74e7;
  }

  :deep(.ant-modal-title) {
    color: white;
  }
</style>
