wupengfei
2025-04-11 ae671e401db4b158b6bd4292fb99fab58e40844c
src/views/Reward/RewardGrant.vue
@@ -69,8 +69,8 @@
  UploadUserFile,
  bolePreview,
} from '@bole-core/components';
import { OrderInputType } from '@bole-core/core';
import { convertApi2FormUrlOnlyOne, format } from '@/utils';
import { Message, OrderInputType } from '@bole-core/core';
import { convertApi2FormUrl, convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils';
import { SettleStatusEnum, SettleStatusEnumText } from '@/constants';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import RewardGrantDialog from './components/RewardGrantDialog.vue';
@@ -142,6 +142,10 @@
    emits: {
      onClick: (role) => openDialog(role),
    },
    extraProps: {
      hide: (row: API.GetParkBountyApplyListOutput) =>
        row.settleStatus === SettleStatusEnum.HasSettle,
    },
  },
  {
    data: {
@@ -150,6 +154,10 @@
    },
    emits: {
      onClick: (role) => handlePreview(role),
    },
    extraProps: {
      hide: (row: API.GetParkBountyApplyListOutput) =>
        row.settleStatus === SettleStatusEnum.WaitForSettle,
    },
  },
]);
@@ -240,16 +248,23 @@
  try {
    let params: API.ParkBountyApplySettleInput = {
      parkBountyApplyId: editForm.parkBountyApplyId,
      settleFileUrl: editForm.settleFileUrl[0].path,
      settleFileUrl: editForm.settleFileUrl.map((x) => x.path).join('|'),
    };
    let res = await parkBountyApplyServices.parkBountyApplySettle(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
function handlePreview(row?: API.GetParkBountyApplyListOutput) {
  bolePreview({
    fileUrl: row.parkName,
  });
  const fileList = row.settleFileUrl?.split('|').map((x) => convertApi2FormUrl(x)) ?? [];
  if (fileList.length > 1) {
    console.log('fileList: ', fileList);
  } else {
    downloadFileByUrl(fileList[0]);
  }
}
</script>