<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="applyVClick">申请</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-position" size="mini" @click="toInfo">点我前往完善个人信息
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="tableData">
      <el-table-column label="#" align="center" prop="id" />
      <el-table-column label="学年" align="center" prop="stuYearName" />
      <el-table-column label="姓名" align="center" prop="stuName" />
      <el-table-column label="审核状态" align="center" prop="applyStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.knzz_tufa_apply_status" :value="scope.row.applyStatus" />
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button v-if="scope.row.applyStatus == '10'" size="mini" type="text" icon="el-icon-refresh"
            @click="reApplyVClick(scope.row)">重新提交
          </el-button>
          <el-button size="mini" type="text" icon="el-icon-view" @click="lookVClick(scope.row)">查看</el-button>
          <el-button v-if="scope.row.applyStatus == '1'" size="mini" type="text" icon="el-icon-edit"
            @click="editVClick(scope.row)">修改
          </el-button>
          <el-button v-if="scope.row.applyStatus == '1'" size="mini" type="text" icon="el-icon-close"
            @click="doCancel(scope.row)">取消申请
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <el-dialog @close="getList" title="申请" :visible.sync="applyV" :fullscreen="true" :destroy-on-close="true">
      <TufaApply v-if="applyV" />
    </el-dialog>
    <el-dialog @close="getList" title="查看" :visible.sync="lookV" :fullscreen="true" :destroy-on-close="true"
      append-to-body>
      <el-row>
        <el-col :span="12">
          <TufaLook id="printDiv" v-if="lookV" :formData="lookForm" />
        </el-col>
        <el-col :span="12">
          <!-- 中职毕业证下载 -->
          <el-form label-width="120px" v-if="lookForm.diplomaCertificate">
            <el-form-item label="中职毕业证">
              <el-button type="primary" size="mini" icon="el-icon-download" @click="downloadDiploma">下载毕业证
              </el-button>

              <el-button type="primary" size="mini" icon="el-icon-download" @click="lookBiye">预览毕业证
              </el-button>

              <el-dialog :visible.sync="lookBiyeV" :destroy-on-close="true" append-to-body>
                <span slot="title">中职毕业证预览</span>
                <iframe v-if="lookBiyeUrl" :src="lookBiyeUrl" style="width: 100%; height: 80vh;"
                  frameborder="0"></iframe>
              </el-dialog>

            </el-form-item>
          </el-form>
          <el-button v-print="printContent">打印</el-button>
          <hr />
          <el-timeline>
            <el-timeline-item v-if="lookForm.fdyCmt && lookForm.fdyDate" :timestamp="lookForm.fdyDate" color="green"
              placement="top">
              <el-card>
                <div>
                  <strong>辅导员审核</strong>
                  <div>{{ lookForm.fdyCmt }}</div>
                  <img v-if="lookForm.fdySign" :src="baseurl + lookForm.fdySign" alt="辅导员签名"
                    style="max-width:100px;margin-top:8px;" />
                </div>
              </el-card>
            </el-timeline-item>
            <el-timeline-item v-if="lookForm.xwCmt && lookForm.xwDate" :timestamp="lookForm.xwDate" color="green"
              placement="top">
              <el-card>
                <div>
                  <strong>院系审核</strong>
                  <div>{{ lookForm.xwCmt }}</div>
                  <img v-if="lookForm.xwSign" :src="baseurl + lookForm.xwSign" alt="院系签名"
                    style="max-width:100px;margin-top:8px;" />
                </div>
              </el-card>
            </el-timeline-item>
            <el-timeline-item v-if="lookForm.xgCmt && lookForm.xgDate" :timestamp="lookForm.xgDate" color="green"
              placement="top">
              <el-card>
                <div>
                  <strong>学工审核</strong>
                  <div>{{ lookForm.xgCmt }}</div>
                  <img v-if="lookForm.xgSign" :src="baseurl + lookForm.xgSign" alt="学工签名"
                    style="max-width:100px;margin-top:8px;" />
                </div>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </el-col>
      </el-row>
    </el-dialog>

    <el-dialog @close="getList" title="修改" :visible.sync="editV" width="900px">
      <el-form label-width="200px" size="mini" class="lookForm">
        <el-form-item label="联系电话">
          <el-input v-model="editForm.stuPhone" />
        </el-form-item>
        <el-form-item label="银行卡号">
          <el-input v-model="editForm.bankCard" />
        </el-form-item>
        <el-form-item label="开户行">
          <el-input v-model="editForm.bankAddr" />
        </el-form-item>
        <el-form-item label="入学时间">
          <el-input v-model="editForm.inTime" />
        </el-form-item>
        <el-form-item label="就读中职学校">
          <el-input v-model="editForm.zzxx" />
        </el-form-item>
        <el-form-item label="家庭人口数">
          <el-input v-model="editForm.familyNum" />
        </el-form-item>
        <el-form-item label="家庭月收入">
          <el-input v-model="editForm.monthMoney" />
        </el-form-item>
        <el-form-item label="人均月收入">
          <el-input v-model="editForm.perMoney" />
        </el-form-item>
        <el-form-item label="收入来源">
          <el-input v-model="editForm.moneySrc" />
        </el-form-item>

        <el-form-item label="中职毕业证">
          <el-upload style="display: inline;" accept=".pdf" :limit="1" class="avatar-uploader" :action="upload.url"
            :headers="upload.headers" :show-file-list="false" :file-list="upload.fileList"
            :on-success="handleDiplomaSuccess" :on-error="handleUploadError">
            <div v-if="editForm.diplomaCertificate" class="pdf-preview">
              <i class="el-icon-document"></i>
              <span>{{ getFileName(editForm.diplomaCertificate) }}</span>
            </div>
            <span v-else> 点击上传中职毕业证(PDF) </span>
          </el-upload>
          <el-button v-if="editForm.diplomaCertificate" type="danger" size="mini" @click="removeDiploma">删除
          </el-button>
        </el-form-item>

        <el-form-item label="">
          <p style="line-height:18pt; margin:0pt; orphans:0; text-align:justify; widows:0">
            <span style="font-family:仿宋; font-size:12pt">本人基于如下第</span><span style="font-family:仿宋; font-size:12pt;">
              <input style="width: 40px;" v-model="editForm.applyReasonNum" type="text" class="underline-input"
                placeholder="请输入">
            </span><span style="font-family:仿宋; font-size:12pt">种原因,符合学费补助申请条件,特提出申请,请审核.</span>
          </p>
          <p style="line-height:18pt; margin:0pt; orphans:0; text-align:justify; widows:0">
            <span style="margin-left: 23px">1.监测对象家庭学生(脱贫不稳定家庭学生、边缘易致贫家庭学生、突发严重困难家庭学生):</span>
            <el-radio-group @change="changeApplyReason" v-model="editForm.applyReason">
              <el-radio :label="'未消除风险;'">未消除风险;
              </el-radio>
              <el-radio :label="'已消除风险;'">已消除风险;
              </el-radio>
              <br>
              <el-radio :label="'2.城乡低保家庭学生;'">2.城乡低保家庭学生;</el-radio>
              <br />
              <el-radio :label="'3.特困救助供养家庭学生;'">3.特困救助供养家庭学生;</el-radio>
              <br />
              <el-radio :label="'4.孤儿(含事实无人抚养儿童);'">4.孤儿(含事实无人抚养儿童);</el-radio>
              <br />
              <el-radio :label="'5.脱贫家庭学生(原建档立卡学生);'">5.脱贫家庭学生(原建档立卡学生);</el-radio>
              <br />
              <el-radio :label="'6.家庭经济困难残疾学生;'">6.家庭经济困难残疾学生;</el-radio>
              <br />
              <el-radio :label="'7.因重大自然灾害、重大事故和重大疾病等导致家庭经济困难的学生;'">
                7.因重大自然灾害、重大事故和重大疾病等导致家庭经济困难的学生;
              </el-radio>
              <br />
              <el-radio :label="'8.其他家庭经济困难因素.'">8.其他家庭经济困难因素.</el-radio>
            </el-radio-group>
          </p>
        </el-form-item>
        <el-form-item label="申请理由补充说明(填写)">
          <el-input type="textarea" v-model="editForm.applyExtraReason" />
        </el-form-item>
        <el-form-item label="佐证材料">
          <FileUpload v-model="editForm.applyFile" />
        </el-form-item>
        <el-form-item label="申请人签名">
          <el-upload style="display: inline;" :before-upload="boolImg" accept="image/jpg,image/jpeg,image/png,image/bmp"
            :limit="1" class="avatar-uploader" :action="upload.url" :headers="upload.headers" :show-file-list="false"
            :file-list="upload.fileList" :on-success="handleAvatarSuccess">
            <img v-if="editForm.applySign" :src="baseurl + editForm.applySign" width="200px" height="50px"
              class="avatar">
            <span v-else> 点击上传</span>
          </el-upload>
        </el-form-item>
        <el-form-item label=" ">
          <el-button type="primary" @click="doEdit" plain>提交修改</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <el-dialog @close="getList" title="重新提交" :visible.sync="reApplyV" width="900px">
      <el-form label-width="200px" size="mini" class="lookForm">
        <el-form-item label="联系电话">
          <el-input v-model="reApplyForm.stuPhone" />
        </el-form-item>
        <el-form-item label="银行卡号">
          <el-input v-model="reApplyForm.bankCard" />
        </el-form-item>
        <el-form-item label="开户行">
          <el-input v-model="reApplyForm.bankAddr" />
        </el-form-item>
        <el-form-item label="入学时间">
          <el-input v-model="reApplyForm.inTime" />
        </el-form-item>
        <el-form-item label="就读中职学校">
          <el-input v-model="reApplyForm.zzxx" />
        </el-form-item>
        <el-form-item label="家庭人口数">
          <el-input v-model="reApplyForm.familyNum" />
        </el-form-item>
        <el-form-item label="家庭月收入">
          <el-input v-model="reApplyForm.monthMoney" />
        </el-form-item>
        <el-form-item label="人均月收入">
          <el-input v-model="reApplyForm.perMoney" />
        </el-form-item>
        <el-form-item label="收入来源">
          <el-input v-model="reApplyForm.moneySrc" />
        </el-form-item>
        <el-form-item label="申请原因">
          <p style="line-height:18pt; margin:0pt; orphans:0; text-align:justify; widows:0">
            <span style="font-family:仿宋; font-size:12pt">本人基于如下第</span><span style="font-family:仿宋; font-size:12pt;">
              <input style="width: 40px;" v-model="reApplyForm.applyReasonNum" type="text" class="underline-input"
                placeholder="请输入">
            </span><span style="font-family:仿宋; font-size:12pt">种原因,符合学费补助申请条件,特提出申请,请审核.</span>
          </p>
          <p style="line-height:18pt; margin:0pt; orphans:0; text-align:justify; widows:0">
            <span style="margin-left: 23px">1.监测对象家庭学生(脱贫不稳定家庭学生、边缘易致贫家庭学生、突发严重困难家庭学生):</span>
            <el-radio-group @change="changeApplyReason1" v-model="reApplyForm.applyReason">
              <el-radio :label="'未消除风险;'">未消除风险;
              </el-radio>
              <el-radio :label="'已消除风险;'">已消除风险;
              </el-radio>
              <br>
              <el-radio :label="'2.城乡低保家庭学生;'">2.城乡低保家庭学生;</el-radio>
              <br />
              <el-radio :label="'3.特困救助供养家庭学生;'">3.特困救助供养家庭学生;</el-radio>
              <br />
              <el-radio :label="'4.孤儿(含事实无人抚养儿童);'">4.孤儿(含事实无人抚养儿童);</el-radio>
              <br />
              <el-radio :label="'5.脱贫家庭学生(原建档立卡学生);'">5.脱贫家庭学生(原建档立卡学生);</el-radio>
              <br />
              <el-radio :label="'6.家庭经济困难残疾学生;'">6.家庭经济困难残疾学生;</el-radio>
              <br />
              <el-radio :label="'7.因重大自然灾害、重大事故和重大疾病等导致家庭经济困难的学生;'">
                7.因重大自然灾害、重大事故和重大疾病等导致家庭经济困难的学生;
              </el-radio>
              <br />
              <el-radio :label="'8.其他家庭经济困难因素.'">8.其他家庭经济困难因素.</el-radio>
            </el-radio-group>
          </p>
        </el-form-item>
        <el-form-item label="申请理由补充说明(填写)">
          <el-input type="textarea" v-model="reApplyForm.applyExtraReason" />
        </el-form-item>
        <el-form-item label="佐证材料">
          <FileUpload v-model="reApplyForm.applyFile" />
        </el-form-item>
        <el-form-item label="申请人签名">
          <el-upload style="display: inline;" :before-upload="boolImg" accept="image/jpg,image/jpeg,image/png,image/bmp"
            :limit="1" class="avatar-uploader" :action="upload.url" :headers="upload.headers" :show-file-list="false"
            :file-list="upload.fileList" :on-success="handleAvatarSuccess1">
            <img v-if="reApplyForm.applySign" :src="baseurl + reApplyForm.applySign" width="200px" height="50px"
              class="avatar">
            <span v-else> 点击上传</span>
          </el-upload>
        </el-form-item>
        <el-form-item label=" ">
          <el-button type="primary" @click="doReApply" plain>重新提交</el-button>
        </el-form-item>
      </el-form>
      <hr />
      <el-timeline>
        <el-timeline-item v-if="reApplyForm.fdyCmt && reApplyForm.fdyDate" :timestamp="reApplyForm.fdyDate"
          color="green" placement="top">
          <el-card>
            <div>
              <strong>辅导员审核</strong>
              <div>{{ reApplyForm.fdyCmt }}</div>
              <img v-if="reApplyForm.fdySign" :src="baseurl + reApplyForm.fdySign" alt="辅导员签名"
                style="max-width:100px;margin-top:8px;" />
            </div>
          </el-card>
        </el-timeline-item>
        <el-timeline-item v-if="reApplyForm.deptCmt && reApplyForm.deptDate" :timestamp="reApplyForm.deptDate"
          color="green" placement="top">
          <el-card>
            <div>
              <strong>院系审核</strong>
              <div>{{ reApplyForm.deptCmt }}</div>
              <img v-if="reApplyForm.deptSign" :src="baseurl + reApplyForm.deptSign" alt="院系签名"
                style="max-width:100px;margin-top:8px;" />
            </div>
          </el-card>
        </el-timeline-item>
        <el-timeline-item v-if="reApplyForm.xgCmt && reApplyForm.xgDate" :timestamp="reApplyForm.xgDate" color="green"
          placement="top">
          <el-card>
            <div>
              <strong>学工审核</strong>
              <div>{{ reApplyForm.xgCmt }}</div>
              <img v-if="reApplyForm.xgSign" :src="baseurl + reApplyForm.xgSign" alt="学工签名"
                style="max-width:100px;margin-top:8px;" />
            </div>
          </el-card>
        </el-timeline-item>
        <el-timeline-item v-if="reApplyForm.leaderCmt && reApplyForm.leaderDate" :timestamp="reApplyForm.leaderDate"
          color="green" placement="top">
          <el-card>
            <div>
              <strong>校领导审核</strong>
              <div>{{ reApplyForm.leaderCmt }}</div>
              <img v-if="reApplyForm.leaderSign" :src="baseurl + reApplyForm.leaderSign" alt="校领导签名"
                style="max-width:100px;margin-top:8px;" />
            </div>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </el-dialog>
  </div>
</template>
<script>
import { boolImg, isEmpty, fullLoading } from "@/api/helpFunc";
import { getTokenKeySessionStorage as getToken } from "@/utils/auth";
import TufaApply from "@/views/comprehensive/knzzZsgApply/cpnt/TufaApply.vue";
import TufaLook from "@/views/comprehensive/knzzZsgApply/cpnt/TufaLook.vue";
import { listStu as listView, doEdit, doCancel, doReApply } from "@/api/comprehensive/knzzZsgApply";

export default {
  name: "tufa-stu",
  dicts: ['knzz_tufa_apply_status'],
  components: { TufaApply, TufaLook },
  data() {
    return {
      loading: true,
      tableData: [],
      total: 0,
      queryParams: { pageNum: 1, pageSize: 10 },
      applyV: false,
      lookForm: {},
      lookV: false,
      editV: false,
      editForm: {},
      upload: {
        headers: { Authorization: "Bearer " + getToken() },
        url: process.env.VUE_APP_BASE_API + "/common/upload",
        fileList: []
      },
      baseurl: process.env.VUE_APP_BASE_API + "/",
      boolImg,
      printContent: { id: 'printDiv', extraCss: "", extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>' },
      reApplyV: false,
      reApplyForm: {},

      lookBiyeV: false,
      lookBiyeUrl: ''
    }
  },
  created() {
    this.getList();
  },
  methods: {

    lookBiye() {
      const isAbsoluteUrl = this.lookForm.diplomaCertificate.startsWith('http');
      const pdfUrl = isAbsoluteUrl
        ? this.lookForm.diplomaCertificate
        : `${this.baseurl}${this.lookForm.diplomaCertificate}`;
      this.lookBiyeUrl = pdfUrl;
      this.lookBiyeV = true;
    },

    handleDiplomaSuccess(response, file, fileList) {
      this.editForm.diplomaCertificate = response.fileName;
      this.upload.fileList = [];
      this.$message.success('上传成功');
    },
    handleUploadError(err, file, fileList) {
      this.$message.error('上传失败,请重试');
      console.error('上传错误:', err);
    },
    toInfo() {
      this.$router.push("/basedata/stuOwnInfo/edit");
    },
    async doReApply() {
      let sdata = { ...this.reApplyForm };
      if (isEmpty(sdata.inTime)) {
        this.$message.info("请填写入学时间");
        return false;
      }
      if (isEmpty(sdata.zzxx)) {
        this.$message.info("请填写就读中职学校");
        return false;
      }
      if (isEmpty(sdata.familyNum)) {
        this.$message.info("请填写家庭人口数");
        return false;
      }
      if (isEmpty(sdata.monthMoney)) {
        this.$message.info("请填写家庭月收入");
        return false;
      }
      if (isEmpty(sdata.perMoney)) {
        this.$message.info("请填写人均月收入");
        return false;
      }
      if (isEmpty(sdata.moneySrc)) {
        this.$message.info("请填写收入来源");
        return false;
      }
      if (isEmpty(sdata.applyReasonNum)) {
        this.$message.info("请填写申请理由序号");
        return false;
      }
      if (isEmpty(sdata.applyReason)) {
        this.$message.info("请填写申请理由");
        return false;
      }
      if (sdata.applyReason && sdata.applyReason.indexOf("1.监测对象家庭学生") === 0 && isEmpty(sdata.applyReason1)) {
        this.$message.info("请选择监测对象家庭学生的风险情况");
        return false;
      }
      if (isEmpty(sdata.applySign)) {
        this.$message.info("请上传申请人签名");
        return false;
      }
      let loading = fullLoading(this);
      let res = await doReApply(sdata);
      loading.close();
      if (res.code == 200) {
        this.$message.success("重新提交成功");
        this.reApplyV = false;
        this.getList();
      }
    },
    handleAvatarSuccess1(response, file, fileList) {
      this.reApplyForm.applySign = response.fileName;
      this.upload.fileList = [];
    },
    reApplyVClick(row) {
      this.reApplyForm = { ...row };
      this.reApplyV = true;
    },
    changeApplyReason1(v) {
      if (v != "1.监测对象家庭学生(脱贫不稳定家庭学生、边缘易致贫家庭学生、突发严重困难家庭学生):") {
        this.reApplyForm.applyReason1 = "";
      }
    },
    changeApplyReason(v) {
      if (v != "1.监测对象家庭学生(脱贫不稳定家庭学生、边缘易致贫家庭学生、突发严重困难家庭学生):") {
        this.editForm.applyReason1 = "";
      }
    },
    handleAvatarSuccess(response, file, fileList) {
      this.editForm.applySign = response.fileName;
      this.upload.fileList = [];
    },
    removeDiploma() {
      this.editForm.diplomaCertificate = '';
      this.upload.fileList = [];
      this.$message.info('文件已删除');
    },
    async getList() {
      this.loading = true;
      let res = await listView(this.queryParams);
      this.loading = false;
      if (res.code == 200) {
        this.tableData = [...res.rows];
        this.total = res.total;
      }
    },
    applyVClick() {
      this.applyV = true;
    },
    lookVClick(row) {
      this.lookForm = { ...row };
      this.lookV = true;
    },
    editVClick(row) {
      this.editForm = { ...row };
      this.editV = true;
    },
    getFileName(path) {
      if (!path) return '';
      return path.split('/').pop();
    },
    downloadDiploma() {
      if (!this.lookForm.diplomaCertificate) return;
      const isAbsoluteUrl = this.lookForm.diplomaCertificate.startsWith('http');
      const pdfUrl = isAbsoluteUrl
        ? this.lookForm.diplomaCertificate
        : `${this.baseurl}${this.lookForm.diplomaCertificate}`;
      const link = document.createElement('a');
      link.href = pdfUrl;
      link.download = this.getFileName(this.lookForm.diplomaCertificate);
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    },
    async doEdit() {
      let sdata = { ...this.editForm };
      if (isEmpty(sdata.stuPhone)) {
        this.$message.info("请填写联系电话");
        return false;
      }
      if (isEmpty(sdata.bankCard)) {
        this.$message.info("请填写银行卡号");
        return false;
      }
      if (isEmpty(sdata.bankAddr)) {
        this.$message.info("请填写开户行");
        return false;
      }
      if (isEmpty(sdata.inTime)) {
        this.$message.info("请填写入学时间");
        return false;
      }
      if (isEmpty(sdata.zzxx)) {
        this.$message.info("请填写就读中职学校");
        return false;
      }
      if (isEmpty(sdata.familyNum)) {
        this.$message.info("请填写家庭人口数");
        return false;
      }
      if (isEmpty(sdata.monthMoney)) {
        this.$message.info("请填写家庭月收入");
        return false;
      }
      if (isEmpty(sdata.perMoney)) {
        this.$message.info("请填写人均月收入");
        return false;
      }
      if (isEmpty(sdata.moneySrc)) {
        this.$message.info("请填写收入来源");
        return false;
      }
      if (isEmpty(sdata.applyReasonNum)) {
        this.$message.info("请填写申请理由序号");
        return false;
      }
      if (isEmpty(sdata.applyReason)) {
        this.$message.info("请填写申请理由");
        return false;
      }
      if (isEmpty(sdata.diplomaCertificate)) {
        this.$message.info("请上传中职毕业证pdf");
        return false;
      }
      if (sdata.applyReason && sdata.applyReason.indexOf("1.监测对象家庭学生") === 0 && isEmpty(sdata.applyReason1)) {
        this.$message.info("请选择监测对象家庭学生的风险情况");
        return false;
      }
      if (isEmpty(sdata.applySign)) {
        this.$message.info("请上传申请人签名");
        return false;
      }
      let loading = fullLoading(this);
      let res = await doEdit(sdata);
      loading.close();
      if (res.code == 200) {
        this.$message.success("修改成功");
        this.editV = false;
        this.getList();
      }
    },
    doCancel(row) {
      let id = row.id;
      this.$confirm('确认取消申请吗?')
        .then(async () => {
          let loading = fullLoading(this);
          let res = await doCancel(id);
          loading.close();
          if (res.code == 200) {
            this.$message.success("取消成功");
            this.getList();
          }
        });
    }
  }
}
</script>
<style scoped lang="scss">
.lookForm .el-form-item {
  margin-bottom: 5px;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader .el-upload:hover {
  border-color: #409EFF;
}

.avatar-uploader .avatar {
  width: 200px;
  height: 150px;
  display: block;
}

.pdf-preview {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  width: 200px;
  height: 150px;
  justify-content: center;
}

.pdf-preview .el-icon-document {
  font-size: 48px;
  color: #409EFF;
  margin-bottom: 10px;
}

.pdf-preview span {
  display: block;
  text-align: center;
  word-break: break-all;
}
</style>
