use Message instead of Toast
This commit is contained in:
@@ -132,17 +132,18 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DialogPlugin, Toast, type DropdownValue } from "tdesign-mobile-vue";
|
||||
import { DialogPlugin, type DropdownValue } from "tdesign-mobile-vue";
|
||||
import { Time, Toolkit, useUserStore } from "timi-web";
|
||||
import EventAPI from "@/api/EventAPI";
|
||||
import EventRecordAPI from "@/api/EventRecordAPI";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
import type { EventItem } from "@/types/EventItem";
|
||||
import type { EventRecordPage, EventRecordPageResult, EventRecordListItemView } from "@/types/EventRecord";
|
||||
import type { EventRecordListItemView, EventRecordPage, EventRecordPageResult } from "@/types/EventRecord";
|
||||
import { getCustomerPhotoURL } from "@/utils/customer";
|
||||
import { getErrorMessage } from "@/utils/error";
|
||||
import { formatEventNumberValue } from "@/utils/eventValue";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
import { Message } from "@/utils/message.ts";
|
||||
|
||||
type DateFilterType = "today" | "yesterday" | "beforeYesterday" | "lastWeek" | "all" | "custom";
|
||||
|
||||
@@ -368,7 +369,7 @@ async function exportExcel(): Promise<void> {
|
||||
...buildRangeReq()
|
||||
});
|
||||
Toolkit.downloadBlob(blob, `登记事件记录-${Time.formatDate(new Date())}.xlsx`);
|
||||
Toast.success("导出已开始");
|
||||
Message.success("导出已开始");
|
||||
} finally {
|
||||
isExporting.value = false;
|
||||
}
|
||||
@@ -424,14 +425,14 @@ async function removeRecord(id: string): Promise<void> {
|
||||
try {
|
||||
await EventRecordAPI.remove(id);
|
||||
await reloadRecords();
|
||||
Toast.success("登记记录已删除");
|
||||
Message.success("登记记录已删除");
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error, "登记记录删除失败");
|
||||
if (message.includes("积分余额不足") || message.includes("余额不足")) {
|
||||
Toast.warning("积分余额不足,请先人工调整积分后再删除登记记录");
|
||||
Message.warning("积分余额不足,请先人工调整积分后再删除登记记录");
|
||||
return;
|
||||
}
|
||||
Toast.error(message);
|
||||
Message.error(message);
|
||||
} finally {
|
||||
isDeleting.value = false;
|
||||
deletingId.value = "";
|
||||
|
||||
Reference in New Issue
Block a user