<template>
  <div class="p-2 volumeCatalog">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" class="mb-[10px]">
        <el-card shadow="hover">
          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
            <el-form-item label="卷册号" prop="volumeNumber">
              <el-input v-model="queryParams.volumeNumber" placeholder="请输入卷册号" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item label="资料名称" prop="documentName">
              <el-input v-model="queryParams.documentName" placeholder="请输入资料名称" clearable @keyup.enter="handleQuery" />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery" v-hasPermi="['design:volumeCatalog:query']">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery" v-hasPermi="['design:volumeCatalog:query']">重置</el-button>
            </el-form-item>
          </el-form>
        </el-card>
      </div>
    </transition>

    <el-card shadow="never">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:volumeCatalog:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <file-upload
              v-model="form.file"
              isImportInfo
              :isShowTip="false"
              uploadUrl="/design/volumeCatalog/importData"
              :limit="1"
              :fileType="['xlsx', 'xls']"
              :data="{
                projectId: currentProject?.id
              }"
              :file-size="50"
              :onUploadSuccess="handleUploadSuccess"
            >
              <el-button v-hasPermi="['design:volumeCatalog:importData']" type="warning" plain icon="Upload">导入</el-button>
            </file-upload>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="Download" @click="exportFile">导出模版</el-button>
          </el-col>
          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
      </template>
      <el-table v-loading="loading" :data="volumeCatalogList">
        <el-table-column label="序号" type="index" width="60" align="center" />
        <el-table-column label="卷册号" align="center" prop="volumeNumber" />
        <el-table-column label="资料名称" align="center" prop="documentName" />
        <el-table-column label="子项名称" align="center" prop="designSubitem" />
        <el-table-column label="设计状态" align="center" prop="designState">
          <template #default="scope">
            <el-tag type="primary" v-if="scope.row.designState == '2'">未出图</el-tag>
            <el-tag type="success" v-if="scope.row.designState == '1'">已出图</el-tag>
            <!-- <dict-tag :options="design_state" :value="scope.row.designState" /> -->
          </template>
        </el-table-column>
        <el-table-column label="专业" align="center" prop="specialtyName"> </el-table-column>
        <el-table-column label="设计人员" align="center" prop="principalName" />
        <el-table-column label="计划出图时间" align="center" prop="plannedCompletion" width="200" />
        <el-table-column label="图纸文件" align="center" prop="remark" width="150">
          <template #default="scope">
            <el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['design:volumeCatalog:listFile']"
              >查看文件</el-button
            >
            <el-badge v-if="scope.row.fileCount" :value="scope.row.fileCount" class="item" type="danger"> </el-badge>
          </template>
        </el-table-column>
        <el-table-column label="外部意见" align="center">
          <template #default="scope">
            <el-link v-if="scope.row.opinion" :href="scope.row.opinion" target="_blank" type="primary"> 查看文件 </el-link>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime" />
        <el-table-column label="备注" align="center" prop="remark" />
        <el-table-column label="操作" align="center" fixed="right" width="200">
          <template #default="scope">
            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:volumeFile:edit']">修改</el-button>
            <el-button
              link
              type="primary"
              icon="Upload"
              @click="handleUpload(scope.row)"
              v-if="scope.row.auditStatus == 'draft' || scope.row.auditStatus == 'back'"
              v-hasPermi="['design:volumeFile:add']"
              >上传图纸</el-button
            >
            <el-button link type="primary" v-hasPermi="['design:volumeFile:edit']" icon="Upload" @click="handleOpinion(scope.row)"
              >外部意见</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改卷册目录对话框 -->
    <el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
      <el-form ref="volumeCatalogFormRef" :model="form" :rules="rules" label-width="110px">
        <el-form-item label="子项" prop="designSubitem">
          <el-input v-model="form.designSubitem" placeholder="请输入设计子项" />
        </el-form-item>
        <el-form-item label="专业" prop="specialty">
          <el-select v-model="form.specialty" placeholder="请选择专业" @change="changeSpecialty">
            <el-option :value="item.userMajor" v-for="item in des_user_major" :key="item.userMajor" :label="item.userMajorName" />
          </el-select>
        </el-form-item>
        <el-form-item label="设计人员" prop="principal">
          <el-select
            :disabled="!form.specialty"
            v-model="form.principal"
            placeholder="请选择设计人员"
            class="transition-all duration-300 border-gray-300"
          >
            <el-option v-for="item in userAppList" :key="item.userId" :label="item.userName" :value="item.userId.toString()" />
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="设计状态" prop="designState">
          <el-select v-model="form.designState" placeholder="请选择设计状态">
            <el-option :value="item.value" v-for="item in design_state" :key="item.value" :label="item.label" />
          </el-select>
        </el-form-item> -->
        <el-form-item label="计划出图时间" prop="plannedCompletion">
          <el-date-picker v-model="form.plannedCompletion" type="date" value-format="YYYY-MM-DD" placeholder="请选择计划出图时间" />
        </el-form-item>
        <el-form-item label="卷册号" prop="volumeNumber">
          <el-input v-model="form.volumeNumber" placeholder="请输入卷册号" />
        </el-form-item>
        <el-form-item label="资料名称" prop="documentName">
          <el-input v-model="form.documentName" placeholder="请输入资料名称" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
    <el-dialog draggable title="上传图纸文件" v-model="uploadVisible" width="500px" append-to-body>
      <el-form :model="uploadForm" label-width="80px" :inline="false">
        <el-form-item label="图纸类型" prop="type">
          <el-select v-model="uploadForm.type" placeholder="请选择图纸类型"
            ><el-option label="过程图纸" value="1" /><el-option label="蓝图" value="3"
          /></el-select>
        </el-form-item>
        <el-form-item v-if="uploadForm.type == '3'" label="蓝图" prop="fileIds">
          <file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100" v-model="uploadForm.fileIds"></file-upload>
        </el-form-item>
        <el-form-item v-if="uploadForm.type == '3'" label="通知人">
          <el-select multiple filterable clearable v-model="form.userIds" placeholder="请选择通知人">
            <el-option :value="item.userId" v-for="item in userCoryList" :key="item.userId" :label="item.nickName + '-' + item.phonenumber" />
          </el-select>
        </el-form-item>
        <el-form-item v-if="uploadForm.type == '1'" label="过程图纸" prop="cancellationIds">
          <file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100" v-model="uploadForm.cancellationIds"></file-upload>
        </el-form-item>
      </el-form>
      <span style="font-size: 12px; color: #999999">注意:请上传pdf格式文件</span>
      <div style="display: flex; justify-content: flex-end">
        <el-button type="primary" @click="onSubmit" :loading="buttonLoading">确定</el-button>
        <el-button @click="uploadVisible = false">取消</el-button>
      </div>
    </el-dialog>
    <!-- 查看文件列表 -->
    <el-dialog draggable title="图纸列表" v-model="viewVisible" width="1000px">
      <el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick">
        <el-tab-pane label="蓝图" name="3">
          <TableContent :data="fileList" :wf-business-status="wf_business_status">
            <template #operation="{ row }">
              <el-button
                link
                type="primary"
                icon="edit"
                @click="handleAuditLantu(row)"
                v-if="(row.status != '2' && row.auditStatus == 'draft') || row.auditStatus == 'back'"
                >审核</el-button
              >
              <el-button link type="primary" icon="View" v-if="row.status != '2' && row.auditStatus != 'draft'" @click="handleAuditViewLantu(row)"
                >查看流程</el-button
              >
              <el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
              <el-button
                type="warning"
                link
                icon="View"
                v-if="(row.status != '2' && row.auditStatus == 'back') || row.auditStatus == 'termination' || row.auditStatus == 'finish'"
                @click="handleViewHistory(row)"
                >查看单据</el-button
              >
            </template>
          </TableContent>
        </el-tab-pane>
        <el-tab-pane label="过程图纸 " name="1">
          <TableContent :data="fileList" :wf-business-status="wf_business_status">
            <template #operation="{ row }">
              <el-button link type="primary" icon="edit" @click="handleAudit(row)" v-if="row.auditStatus == 'draft' || row.auditStatus == 'back'"
                >审核</el-button
              >
              <el-button link type="primary" icon="View" v-if="row.status != '2' && row.auditStatus != 'draft'" @click="handleAuditView(row)"
                >查看流程</el-button
              >
              <el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
              <el-button
                type="warning"
                link
                icon="View"
                v-if="row.auditStatus == 'back' || row.auditStatus == 'termination' || row.auditStatus == 'finish'"
                @click="handleViewHistory(row)"
                >查看单据</el-button
              >
            </template>
          </TableContent>
        </el-tab-pane>
        <el-tab-pane label="作废 " name="4">
          <TableContent :data="fileList" :wf-business-status="wf_business_status">
            <template #operation="{ row }">
              <el-button type="danger" link icon="Download" @click="handleDownload(row)"> 下载 </el-button>
            </template>
          </TableContent>
        </el-tab-pane>
      </el-tabs>
      <template #footer>
        <span>
          <el-button type="danger" @click="viewVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <el-dialog draggable title="单据" v-model="dialogHistory" width="800px">
      <histroy ref="histroyRef"></histroy>
    </el-dialog>
    <el-dialog draggable title="上传外部意见" v-model="uploadOpinionVisible" width="500px" append-to-body>
      <el-form :model="updateRow" label-width="80px" :inline="false">
        <el-form-item label="外部意见">
          <file-upload :fileType="['pdf']" :isShowTip="false" :fileSize="100" :onUploadSuccess="onUploadSuccess" v-model="opinion"></file-upload>
        </el-form-item>
      </el-form>
      <span style="font-size: 12px; color: #999999">注意:请上传pdf格式文件</span>
      <div style="display: flex; justify-content: flex-end">
        <el-button type="primary" @click="onSubmitOpinion">确定</el-button>
        <el-button @click="uploadOpinionVisible = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script setup name="VolumeCatalog" lang="ts">
import {
  listVolumeCatalog,
  getVolumeCatalog,
  delVolumeCatalog,
  addVolumeCatalog,
  updateVolumeCatalog,
  uploadVolumeFile,
  majorList,
  getVolumeCatafileList,
  volumeFileList,
  copyUserList
} from '@/api/design/volumeCatalog';
import { VolumeCatalogVO } from '@/api/design/volumeCatalog/types';
import { useUserStoreHook } from '@/store/modules/user';
import histroy from './comm/histroy.vue';
import TableContent from './comm/tableContent.vue';
const fileList = ref([]);
import { designUserList } from '@/api/design/appointment';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { design_state, wf_business_status } = toRefs(proxy?.useDict('design_state', 'wf_business_status'));
import { drawingreviewReceiptsDetail, drawingreviewReceiptsList } from '@/api/design/drawingreview';
const volumeCatalogList = ref<VolumeCatalogVO[]>([]);
const des_user_major = ref([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const histroyRef = ref<InstanceType<typeof histroy>>();
const TableContentRef = ref<InstanceType<typeof TableContentRef>>();
const single = ref(true);
const multiple = ref(true);
const activeName = ref('3');
const uploadOpinionVisible = ref(false);
const design = ref('');
const total = ref(0);
const dialogHistory = ref(false);
const userCoryList = ref([]);
const opinion = ref('');
const updateRow = ref({
  opinion: []
});
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const queryFormRef = ref<ElFormInstance>();
const volumeCatalogFormRef = ref<ElFormInstance>();

const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});

const uploadForm = reactive({
  userIds: [],
  volumeCatalogId: undefined,
  fileIds: undefined,
  cancellationIds: undefined,
  explainText: '',
  fileList: [],
  type: '1',
  cancellationIds: [] // 用于存储已作废的文件ID
});
const examineForm = ref({
  audit: '',
  auditDate: '',
  auditId: '',
  designer: '',
  executionOpinion: '',
  executor: '',
  executorDate: '',
  executorId: '',
  id: '1',
  num: '',
  professional: '',
  projectId: '',
  projectName: '',
  proofreading: '',
  proofreadingDate: '',
  proofreadingId: '',
  stage: '',
  subprojectId: '',
  subprojectName: '',
  verificationContent: '',
  verificationOpinion: '',
  volume: ''
});
const userList = ref([]);
const userAppList = ref([]); //人事任命的用户
const initFormData: any = {
  design: undefined,
  projectId: currentProject.value?.id || '',
  designSubitemId: undefined,
  volumeNumber: undefined,
  documentName: undefined,
  designState: '2',

  remark: undefined
};
const data = reactive({
  form: { ...initFormData },
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    projectId: currentProject.value?.id,
    designSubitemId: undefined,
    volumeNumber: undefined,
    documentName: undefined,
    params: {}
  },
  rules: {
    design: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
    projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
    designSubitem: [{ required: true, message: '子项不能为空', trigger: 'blur' }],
    volumeNumber: [{ required: true, message: '卷册号不能为空', trigger: 'blur' }],
    documentName: [{ required: true, message: '资料名称不能为空', trigger: 'blur' }],
    plannedCompletion: [{ required: true, message: '计划出图事件不能为空', trigger: 'blur' }],
    principal: [{ required: true, message: '设计人员不能为空', trigger: 'blur' }],
    specialty: [{ required: true, message: '专业不能为空', trigger: 'blur' }]
  }
});

const { queryParams, form, rules } = toRefs(data);
const changeSpecialty = (val) => {
  form.value.principal = ''; //清空
  getUserAppList(val);
};
// 获取专业列表
const getSpecialtyList = async () => {
  const res = await majorList({ projectId: currentProject.value?.id, userType: 2 });
  console.log(res);
  if (res.code === 200) {
    des_user_major.value = res.data;
  }
};
/** 查询卷册目录列表 */
const getList = async () => {
  loading.value = true;
  try {
    const res = await listVolumeCatalog(queryParams.value);
    volumeCatalogList.value = res.rows;
    total.value = res.total;
  } finally {
    loading.value = false;
  }
};
const getUserAppList = async (userMajor) => {
  const res = await designUserList({ projectId: currentProject.value?.id, userType: 2, userMajor });
  if (res.code === 200) {
    userAppList.value = res.rows;
  }
};
const handleViewHistory = async (row) => {
  // 查看历史流程记录
  dialogHistory.value = true;
  // 查看历史流程记录
  nextTick(() => {
    histroyRef.value?.getList(row.id);
  });
};
const handleShowInfo = (val) => {
  getDetails(val);
};
const getDetails = async (id) => {
  let res = await drawingreviewReceiptsDetail(id);
  examineForm.value = res.data;
};
/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
};
// 获取人员列表
const getDesignUserList = async () => {
  const res = await copyUserList({ projectId: currentProject.value?.id, userType: 2 });
  if (res.code === 200) {
    userCoryList.value = res.data;
  }
};
/** 表单重置 */
const reset = () => {
  form.value = { ...initFormData };
  volumeCatalogFormRef.value?.resetFields();
};

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  handleQuery();
};

/** 多选框选中数据 */
const handleSelectionChange = (selection: VolumeCatalogVO[]) => {
  ids.value = selection.map((item) => item.design);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
};

/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = '添加设计出图计划';
};

const handleView = (row?: any) => {
  fileList.value = row.fileVoList;
  design.value = row.design;
  activeName.value = '3';
  getVolumeFileList('3');
  viewVisible.value = true;
};

/** 上传文件按钮操作 */
const uploadVisible = ref(false);
const viewVisible = ref(false);
// 上传外部意见
const handleOpinion = (row) => {
  uploadOpinionVisible.value = true;
  updateRow.value = row;
  opinion.value = '';
};
const onSubmitOpinion = async () => {
  // 提交外部意见
  if (opinion.value.length == 0) {
    proxy.$modal.msgError('请上传外部意见');
    return;
  }
  await updateVolumeCatalog({ ...updateRow.value });
  proxy?.$modal.msgSuccess('操作成功');
  uploadOpinionVisible.value = false;
  await getList();
};
const onUploadSuccess = (fileList, res) => {
  if (res.code == 200) {
    updateRow.value.opinion = res.data.url;
  }
};
const handleUpload = async (row?: any) => {
  // 判断是否有专业和设计人员
  if (!row?.principalName || !row?.specialtyName) {
    proxy?.$modal.warning('请先选择专业和设计人员');
    return;
  }
  resetUploadForm();
  uploadForm.volumeCatalogId = row.design;
  userList.value = row.noViewerList;
  const res = await getVolumeCatafileList(row.design);
  uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
  uploadVisible.value = true;
};
/** 重置上传表单 */
const resetUploadForm = () => {
  uploadForm.userIds = [];
  uploadForm.volumeCatalogId = undefined;
  uploadForm.fileIds = undefined;
  uploadForm.cancellationIds = undefined;
  uploadForm.explainText = '';
  uploadForm.fileList = [];
  uploadForm.type = '1';
  uploadForm.cancellationIds = [];
};

/** 提交按钮 */
const submitForm = () => {
  volumeCatalogFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.design) {
        await updateVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
      } else {
        await addVolumeCatalog(form.value).finally(() => (buttonLoading.value = false));
      }
      proxy?.$modal.msgSuccess('操作成功');
      dialog.visible = false;
      await getList();
    }
  });
};

const handleDownload = (row: any) => {
  proxy?.$download.oss(row.fileId);
};

/** 上传文件提交 */
const onSubmit = async () => {
  buttonLoading.value = true;
  let cancellationIds = [];
  let fileIds = [];
  if (uploadForm.cancellationIds && uploadForm.cancellationIds.length > 0) {
    cancellationIds = uploadForm.cancellationIds.split(',');
  }
  if (uploadForm.fileIds && uploadForm.fileIds.length > 0) {
    fileIds = uploadForm.fileIds.split(',');
  }
  let obj = {
    volumeCatalogId: uploadForm.volumeCatalogId,
    fileIds: fileIds,
    cancellationIds: cancellationIds,
    type: uploadForm.type
  };
  try {
    await uploadVolumeFile({ ...obj, userIds: form.value.userIds });
    proxy?.$modal.msgSuccess('文件上传成功');
    uploadVisible.value = false;
    await getList();
  } catch (error) {
    console.error('上传文件失败:', error);
  } finally {
    buttonLoading.value = false;
  }
};
/** 删除按钮操作 */
const handleDelete = async (row?: VolumeCatalogVO) => {
  const _ids = row?.design || ids.value;
  await proxy?.$modal.confirm('是否确认删除卷册目录编号为"' + _ids + '"的数据项？').finally(() => (loading.value = false));
  await delVolumeCatalog(_ids);
  proxy?.$modal.msgSuccess('删除成功');
  await getList();
};

const handleUploadSuccess = async (flieList: any, res: any) => {
  proxy?.$modal.msgSuccess('文件上传成功');
  getList();
};
/** 审核蓝图按钮操作 */
const handleAuditLantu = async (row) => {
  proxy.$tab.closePage(proxy.$route);
  proxy.$router.push({
    path: `/approval/volumeCatalog/blueprintEdit`,
    query: {
      id: row.id,
      type: 'update'
    }
  });
};
/** 查看蓝图按钮操作 */
const handleAuditViewLantu = async (row) => {
  proxy.$tab.closePage(proxy.$route);
  proxy.$router.push({
    path: `/approval/volumeCatalog/blueprintEdit`,
    query: {
      id: row.id,
      type: 'view'
    }
  });
};
/** 审核过程按钮操作 */
const handleAudit = async (row) => {
  proxy.$tab.closePage(proxy.$route);
  proxy.$router.push({
    path: `/approval/volumeCatalog/indexEdit`,
    query: {
      id: row.id,
      type: 'update'
    }
  });
};
/** 查看按钮操作 */
const handleAuditView = async (row) => {
  proxy.$tab.closePage(proxy.$route);
  proxy.$router.push({
    path: `/approval/volumeCatalog/indexEdit`,
    query: {
      id: row.id,
      type: 'view'
    }
  });
};
/** 修改按钮操作 */
const handleUpdate = async (row?: VolumeCatalogVO) => {
  reset();
  const _id = row?.design || ids.value[0];
  const res = await getVolumeCatalog(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = '修改设计出图计划';
};
// 获取文件列表
const getVolumeFileList = async (type) => {
  let res = await volumeFileList({ volumeCatalogId: design.value, type });
  fileList.value = [];
  if (res.code === 200) {
    fileList.value = res.rows;
  }
};
const exportFile = () => {
  proxy?.download(
    '/design/volumeCatalog/exportExcel',
    {
      projectId: currentProject.value?.id
    },
    `设计出图计划导入模版.xlsx`
  );
  // // 导出模版文件
  // try {
  //   // 创建a标签
  //   const link = document.createElement('a');
  //   // 设置PDF文件路径 - 相对于public目录
  //   link.href = '/catalog.xlsx';
  //   // 设置下载后的文件名
  //   link.download = '设计出图计划导入模版.xlsx';
  //   // 触发点击
  //   document.body.appendChild(link);
  //   link.click();
  //   // 清理
  //   document.body.removeChild(link);
  // } catch (error) {
  //   alert('下载失败，请重试');
  // }
};
// 切换
const handleClick = (val) => {
  getVolumeFileList(val.props.name);
};
const handleAuditInfo = (row) => {
  // 审核图纸
};
onMounted(() => {
  getDesignUserList();
  getSpecialtyList();
  getList();
});

//监听项目id刷新数据
const listeningProject = watch(
  () => currentProject.value?.id,
  (nid, oid) => {
    queryParams.value.projectId = nid;
    form.value.projectId = nid;
    getDesignUserList();
    getSpecialtyList();
    getList();
  }
);

onUnmounted(() => {
  listeningProject();
});
</script>
<style lang="scss">
.volumeCatalog_box {
  /* .upload-demo {
    width: 100% !important;
  } */
  table {
    border-collapse: collapse; //合并为一个单一的边框
    border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
  }

  thead {
    tr {
      th {
        background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
        height: 35px; //设置单元格最小高度
        text-align: center;
        letter-spacing: 5px;
        padding: 15px;
      }

      td {
        text-align: left;
        height: 35px; //设置单元格最小高度
        padding: 15px;
      }

      .th-bg {
        background-color: rgba(247, 247, 247, 1);
      }
    }
  }

  tbody {
    tr {
      td {
        text-align: left;
        height: 40px; //设置单元格最小高度
        padding: 15px;
      }

      th {
        height: 35px; //设置单元格最小高度
        text-align: center;
        letter-spacing: 5px;
        padding: 15px;
      }
    }
  }

  .table-content {
    box-shadow: 0px 0px 10px #ddd;
    padding: 20px;
    position: relative;
  }
}
</style>
