use Message instead of Toast

This commit is contained in:
Timi
2026-08-22 01:08:23 +08:00
parent 94c17e6d81
commit e2af521996
46 changed files with 291 additions and 289 deletions
+9 -8
View File
@@ -84,11 +84,12 @@
</template>
<script setup lang="ts">
import { DialogPlugin, Toast, type CalendarProps, type TDate } from "tdesign-mobile-vue";
import { type CalendarProps, DialogPlugin, type TDate } from "tdesign-mobile-vue";
import { useUserStore } from "timi-web";
import StoreAPI from "@/api/StoreAPI";
import type { Store, StoreBusinessDay, StoreBusinessDayStatus } from "@/types/Store";
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
import { Message } from "@/utils/message";
defineOptions({
name: "StoreBusinessDayCalendar"
@@ -167,7 +168,7 @@ async function handlePanelChange(context: { year: number; month: number }): Prom
try {
await loadCalendar(context.year, context.month);
} catch {
Toast.error("营业日加载失败");
Message.error("营业日加载失败");
}
}
@@ -226,11 +227,11 @@ async function saveDay(): Promise<void> {
} else {
await StoreAPI.createBusinessDay(day);
}
Toast.success("营业日已保存");
Message.success("营业日已保存");
editorVisible.value = false;
await loadCalendar(calendarMonth.year, calendarMonth.month);
} catch {
Toast.error("营业日保存失败");
Message.error("营业日保存失败");
} finally {
isSaving.value = false;
}
@@ -238,7 +239,7 @@ async function saveDay(): Promise<void> {
function validateDay(): boolean {
if (!formModel.dateText) {
Toast.warning("请选择日期");
Message.warning("请选择日期");
return false;
}
return true;
@@ -271,11 +272,11 @@ async function removeDay(id: string): Promise<void> {
isDeleting.value = true;
try {
await StoreAPI.removeBusinessDay(id);
Toast.success("营业日已删除");
Message.success("营业日已删除");
editorVisible.value = false;
await loadCalendar(calendarMonth.year, calendarMonth.month);
} catch {
Toast.error("营业日删除失败");
Message.error("营业日删除失败");
} finally {
isDeleting.value = false;
}
@@ -311,7 +312,7 @@ onMounted(async () => {
]);
store.value = currentStore;
} catch {
Toast.error("营业日数据加载失败");
Message.error("营业日数据加载失败");
}
});
</script>