zhengyiming
3 天以前 fc6bbae5805da6c95fd675210999a03802cd62ad
src/components/commonView/FourStreamsBatchMaterialFileDialog.vue
@@ -53,6 +53,8 @@
} from '@bole-core/components';
import { format, downloadFileByUrl, formatFileSize } from '@/utils';
import { downloadWithZip, Message, isFileCanPreview } from '@bole-core/core';
import { CustomerApplyFileTypeListItem, EnterpriseApplyFileUtils } from './utils';
import { FourStreamsExtraMaterialFileSearchType, SearchType } from '@/constants';
defineOptions({
  name: 'FourStreamsBatchMaterialFileDialog',
@@ -62,10 +64,13 @@
  name?: string;
  zipName?: string;
  showDeleteBtn?: boolean;
  showMaterialExtraFileDeleteBtn?: boolean;
  fileSearchTypeId?: string;
};
const props = withDefaults(defineProps<Props>(), {
  showDeleteBtn: true,
  showMaterialExtraFileDeleteBtn: false,
});
const visible = defineModel<boolean>('visible');
@@ -87,22 +92,22 @@
]);
const operationBtns = defineOperationBtns([
  // {
  //   data: {
  //     enCode: 'detailBtn',
  //     name: '查看',
  //   },
  //   emits: {
  //     onClick: (row) => handlePreview(row),
  //   },
  //   extraProps: {
  //     hide: (row: UploadUserFile) => !isFileCanPreview(row.path),
  //   },
  // },
  {
    data: {
      enCode: 'detailBtn',
      name: '查看',
    },
    emits: {
      onClick: (row) => handlePreview(row),
    },
    extraProps: {
      hide: (row: UploadUserFile) => !isFileCanPreview(row.path),
    },
  },
  {
    data: {
      enCode: 'downloadBtn',
      name: '查看',
      name: '下载',
    },
    emits: {
      onClick: (row) => handleDownload(row),
@@ -120,7 +125,13 @@
      onClick: (row) => handleDelete(row),
    },
    extraProps: {
      hide: (row) => !props.showDeleteBtn,
      hide: (row: API.CustomerUploadMonthApplyFileTypeDto) => {
        if (EnterpriseApplyFileUtils.isApplyUploadExtraFileSearchTypeId(props.fileSearchTypeId)) {
          return !props.showMaterialExtraFileDeleteBtn;
        } else {
          return !props.showDeleteBtn;
        }
      },
    },
  },
]);