Quellcode durchsuchen

feat(订单实时): 退款记录页接线 —— lsy_refund 单通道静默重拉

alphaH vor 1 Woche
Ursprung
Commit
0cbce07b4a
1 geänderte Dateien mit 15 neuen und 6 gelöschten Zeilen
  1. 15 6
      frontend/src/views/module_payment/collection/refund/index.vue

+ 15 - 6
frontend/src/views/module_payment/collection/refund/index.vue

@@ -73,7 +73,7 @@
         :page-sizes="[10, 20, 50, 100]"
         layout="total, sizes, prev, pager, next, jumper"
         style="margin-top: 12px; justify-content: flex-end"
-        @change="loadData"
+        @change="() => loadData()"
       />
     </el-card>
   </div>
@@ -92,6 +92,7 @@ defineOptions({
 
 import { onMounted, reactive, ref } from "vue";
 import { getLsyRefundPage } from "@/api/module_payment/collection";
+import { useLiveRefetch } from "@/composables";
 
 const STATUS_LABEL: Record<string, string> = {
   CREATED: "已建单",
@@ -113,15 +114,19 @@ function statusLabel(v: string) {
   return STATUS_LABEL[v] || v;
 }
 
-async function loadData() {
-  loading.value = true;
+async function loadData(silent = false) {
+  if (!silent) {
+    loading.value = true;
+  }
   try {
-    const res: any = await getLsyRefundPage(query);
+    const res: any = await getLsyRefundPage(query, silent);
     // 两层 `.data.data`(响应拦截器不解包);分页字段名是 `list`
     list.value = res.data.data?.list || [];
     total.value = res.data.data?.total || 0;
   } finally {
-    loading.value = false;
+    if (!silent) {
+      loading.value = false;
+    }
   }
 }
 
@@ -136,5 +141,9 @@ function handleReset() {
   loadData();
 }
 
-onMounted(loadData);
+// 退款记录页:只听 lsy_refund。本页没有勾选/弹窗/行内操作 ⇒ 不传 busy。
+// 退款的写入信号来自后端同一条广播(lsy_refund 通道),订单页与这一页各订各的。
+useLiveRefetch(["lsy_refund"], () => loadData(true));
+
+onMounted(() => loadData());
 </script>