<template>
  <div class="modalSty" ref="refModel">
    <a-modal
      v-model:visible="visible"
      title="添加"
      @ok="handleOk"
      width="1300px"
      :bodyStyle="{ padding: '20px' }"
      :getContainer="() => $refs.refModel"
    >
      <a-row>
        <a-col :span="14">
          <div class="left" style="margin-right: 20px">
            <a-form
              :model="formState"
              name="basic"
              :label-col="{ style: { width: '100px' } }"
              autocomplete="off"
              @finish="onFinish"
              @finishFailed="onFinishFailed"
            >
              <a-row>
                <a-col :span="24">
                  <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="仓库级别">
                    <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="分管领导"
                    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="责任人"
                    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="经度"
                    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="24">
                  <a-form-item label="备注">
                    <a-textarea v-model:value="formState.username" :auto-size="{ minRows: 5 }" />
                  </a-form-item>
                </a-col>
              </a-row>
            </a-form>
          </div>
        </a-col>
        <a-col :span="10">
          <div class="right">
            位置
            <div style="height: 400px; background: #f8f8f8"></div>
          </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>
