<template>
  <!-- <CollapseContainer title="基本设置" :canExpan="false">
    <a-row :gutter="24" class="py-8">
      <a-col :span="8">
        <div class="change-avatar">
          <div class="mb-2"> 头像 </div>
          <img :src="avatar" class="avatar" />
        </div>
      </a-col>
      <a-col :span="14">
        <BasicForm @register="register" />
        <div style="text-align: center">
          <Button type="primary" @click="handleSubmit">保存</Button>
        </div>
      </a-col>
    </a-row>
  </CollapseContainer> -->
  <div />
</template>
<script lang="ts">
  // import { Button, Row, Col } from 'ant-design-vue';
  import { computed, defineComponent, onMounted } from 'vue';
  // import { BasicForm, useForm } from '/@/components/Form/index';
  // import { CollapseContainer } from '/@/components/Container';
  // // import { CropperAvatar } from '/@/components/Cropper';

  // import { useMessage } from '/@/hooks/web/useMessage';

  // import headerImg from '/@/assets/images/header.png';
  // import { getAccountInfo, saveAccountInfo } from '/@/api/sys/sysUserApi';
  // import { baseSetschemas } from './data';
  // import { useUserStore } from '/@/store/modules/user';
  // import { uploadApi } from '/@/api/common';
  // import { listDictModel } from '/@/api/common';

  export default defineComponent({
    //   components: {
    //     BasicForm,
    //     CollapseContainer,
    //     Button,
    //     ARow: Row,
    //     ACol: Col,
    //     // CropperAvatar,
    //   },
    //   setup() {
    //     const { createMessage } = useMessage();
    //     const userStore = useUserStore();
    //     const [register, { setFieldsValue, updateSchema, validate }] = useForm({
    //       size: 'large',
    //       labelWidth: 120,
    //       schemas: baseSetschemas,
    //       showActionButtonGroup: false,
    //     });
    //     onMounted(async () => {
    //       const sexOptions = await listDictModel({ dictCode: 'sys_sex' });
    //       const data = await getAccountInfo();
    //       data.sex = String(data.sex.value);
    //       setFieldsValue(data);
    //       updateSchema([
    //         {
    //           field: 'sex',
    //           componentProps: {
    //             options: sexOptions,
    //           },
    //         },
    //       ]);
    //     });
    //     const avatar = computed(() => {
    //       const { avatar } = userStore.getUserInfo;
    //       return avatar || headerImg;
    //     });
    //     function updateAvatar(src: string) {
    //       const userinfo = userStore.getUserInfo;
    //       userinfo.avatar = src;
    //       userStore.setUserInfo(userinfo);
    //     }
    //     return {
    //       avatar,
    //       register,
    //       uploadApi,
    //       updateAvatar,
    //       handleSubmit: async () => {
    //         const values = await validate();
    //         const userinfo = userStore.getUserInfo;
    //         await saveAccountInfo({ ...values, avatar: userinfo?.avatar || null });
    //         userinfo.realName = values['nickname'];
    //         userStore.setUserInfo(userinfo);
    //         createMessage.success('更新成功！');
    //       },
    //     };
    //   },
  });
</script>

<style lang="less" scoped>
  .change-avatar {
    text-align: center;

    img {
      display: block;
      width: 200px;
      height: 200px;
      border-radius: 50%;
      margin: 0 auto 15px;
    }
  }
</style>
